Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Oracle Sql Statement
Message
 
 
À
Tous
Information générale
Forum:
Oracle
Catégorie:
Autre
Titre:
Oracle Sql Statement
Divers
Thread ID:
00802182
Message ID:
00802182
Vues:
74
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform