General information
Title:
Oracle Sql Statement
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only