Re: Optimizer behavior - DOH!
Posted in 1996
Bob Payne (bpayne@netcom.com) wrote:
: Does the optimizer use partial indexes? In other words, if I have an
: index on the sku column, warehouse column and the date column, do I have to
: include all three of those in my where-clause?
When you have a composite index on several columns, the optimizer will
use that index for a query over the first column in the index, not over
the others.
E.G.: create index ix_sample1 on tab1 (col1, col2, col3);
is functionally equivalent to
create index ix_sample2 on tab1 (col1);
but if you need an index for col2 and col3, too, then ix_sample1 will
do you no good.
HTH, Richard
--
+----------------------------+-------------------------------------------+
| Dr. Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de |
| EDV-Gruppe Anaesthesie | Tel : +49-89-7095-3413 |
| Klinikum Grosshadern | FAX : +49-89-7095-8886 |
| 81366 Munich, Germany | |
+----------------------------+-------------------------------------------+