Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oracle Sql Statement
Message
 
 
To
All
General information
Forum:
Oracle
Category:
Other
Title:
Oracle Sql Statement
Miscellaneous
Thread ID:
00802182
Message ID:
00802182
Views:
67
This is my oracle statement:

SELECT * FROM VOTER ;
WHERE tdob >= to_date('12/31/1971 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM')
AND tdob <= to_date('12/31/1971 11:59:59 PM', 'MM/DD/YYYY HH:MI:SS AM')
AND cvotstatus = 'A'


I have index expressions on TDOB and CVOTSTATUS on my Voter Table.
My Tables has 650,000 records
My Result set will contain 23 records.

Running it this way takes forever.

If I run it this way, it returns my record set in 1 second. I am using Visual FoxPro 8 w/ the Oracle ODBC driver.:

SELECT * FROM VOTER ;
WHERE tdob BETWEEN to_date('12/31/1971 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM')
AND to_date('12/31/1971 11:59:59 PM', 'MM/DD/YYYY HH:MI:SS AM')
AND UPPER(cvotstatus) = 'A'

Why isn't oracle smart enough to see that the TDOB filter is going to bring my data set down to a smaller number of records like Foxpro would??????? Is there anything I can do to tell orcale when running to filter based on the order the appear in the filter expression like in VPF?

TIA
Mark Moore

btw, I am new at oracle, so be kind.
Next
Reply
Map
View

Click here to load this message in the networking platform