Re: Keys, Wheres, and Order bys

2002-08-21 Thread Neil Mansilla
On Wed, 21 Aug 2002, Brian Moon wrote: > If I have a query like: > select field1 from table where field2=0 order by field3 desc limit 30; > and I have keys: > key field2 (field2) > key field3 (field3) > > Will MySQL use one key to select and one to order? Or do I need a: > > key field2_field3 (

Re: Keys, Wheres, and Order bys

2002-08-21 Thread Dave Reinhardt
try select * from table where field2=0 order by field3 desc limit 30 I think you need the column to compare. > If I have a query like: > > select field1 from table where field2=0 order by field3 desc limit 30; > > and I have keys: > > key field2 (field2) > key field3 (field3) > > Will MySQL u

Keys, Wheres, and Order bys

2002-08-21 Thread Brian Moon
If I have a query like: select field1 from table where field2=0 order by field3 desc limit 30; and I have keys: key field2 (field2) key field3 (field3) Will MySQL use one key to select and one to order? Or do I need a: key field2_field3 (field2, field3) This is a big table and i don't want