Re: Choosing Indices
Posted in 1996
On Tue, 30 Jan 1996, Joseph Kormann wrote: } } > On Tue, 30 Jan 1996, Joseph Kormann wrote: } > } > > Is there a way to choose the main index that you want to search on? } > > } > > If I have a where clause with two statements. Both statements have their } > > own indices. Problem is I want the query to run the initial index off the } > > second statment, then subquery to the first statement. } > > } > > I've tried reversing the statment order, but SQL still does it the same } > > way. Any help? } > > } On Tue, 30 Jan 1996, Nick Nobbe wrote: } > Joseph, } > No offense but can you show us what you're trying. } > Yours, } > Nick } > } } Select * } from table1 } where x = '1' and } y = '11'; } } There's separate indices on x and y. I want to find everything for y } first, then for x. If I do a 'Set Explain On', it shows that SQL first } looks up by x then by y. I want the main index to be y. } } Any help? } Joseph, What about order by y,x and see what the optimizer says. Yours, Nick }