generated SQL not using index
Posted: Thu 10 Mar 2011 17:11
Hi,
I have a table for which the primary key is Number(19,0)
( on Oracle).
The key in the model is mapped to int64 ( in conceptual and storage layer).
When i make a query, the gererated sql looks like :
SELECT *
FROM AFDA.AFDA_VRGESCHR_ZORGEN "Extent1"
WHERE ( CAST("Extent1".PATIENT_NR AS NUMBER)) = 15505;
So the SQL casts the key as number even when it is already a number.
This makes it so that my index on 'PATIENT_NR' is not used.
I Map the Property to INT64 becus i want to use long in code instead of decimal !
Is there anything i can do to fix this mapping problem ?
greetings
Stijn
I have a table for which the primary key is Number(19,0)
( on Oracle).
The key in the model is mapped to int64 ( in conceptual and storage layer).
When i make a query, the gererated sql looks like :
SELECT *
FROM AFDA.AFDA_VRGESCHR_ZORGEN "Extent1"
WHERE ( CAST("Extent1".PATIENT_NR AS NUMBER)) = 15505;
So the SQL casts the key as number even when it is already a number.
This makes it so that my index on 'PATIENT_NR' is not used.
I Map the Property to INT64 becus i want to use long in code instead of decimal !
Is there anything i can do to fix this mapping problem ?
greetings
Stijn