Re: Index not used for order by when more than 1 field selected, no where clause

2001-02-18 Thread Jeremy D. Zawodny
On Fri, Feb 16, 2001 at 10:56:57PM +0100, Benjamin Pflugmann wrote: When you set up your database server so that it has enough RAM to keep the whole database in main memory (buffer cache), random reads don't need to wait for physical disk seeks and can be very fast. [...] So my

Re: Index not used for order by when more than 1 field selected, no where clause

2001-02-16 Thread Joseph Bueno
Benjamin Pflugmann wrote : Hi. [] If MySQL uses the index, it has one of two possibilities. First: 1. Read the whole isbn index, and for each row 2. seek the record in the data file and get author from it. This is quite slow because of the random file seeks needed. Second: 1.

Re: Index not used for order by when more than 1 field selected, no where clause

2001-02-16 Thread Benjamin Pflugmann
Hi. On Fri, Feb 16, 2001 at 09:42:02AM +0100, [EMAIL PROTECTED] wrote: Benjamin Pflugmann wrote : [...] "Second" is never the best way. MySQL uses "First" up to some percentage of the amount of records (30% I believe), then uses "Third", because reading the data in file order (unsorted)

RE: Index not used for order by when more than 1 field selected, no where clause

2001-02-15 Thread Quentin Bennett
Hi, I think you are mis-understanding the information provided. What the "using index" note means is that the isbn column is part of the index, and since that is all that is selected, the index file is used to provide the data, the data file is not touched. Since there is (usually) less data in

Re: Index not used for order by when more than 1 field selected, no where clause

2001-02-15 Thread François Bélanger
15/02/01 15:14, Quentin Bennett, [EMAIL PROTECTED]: Hi, I think you are mis-understanding the information provided. What the "using index" note means is that the isbn column is part of the index, and since that is all that is selected, the index file is used to provide the data, the data

Re: Index not used for order by when more than 1 field selected, no where clause

2001-02-15 Thread Benjamin Pflugmann
Hi. On Thu, Feb 15, 2001 at 03:53:39PM -0500, [EMAIL PROTECTED] wrote: 15/02/01 15:14, Quentin Bennett, [EMAIL PROTECTED]: [...] Adding the author to the query means that the query now has to go to the data file to get the information, and since there is no restriction on isbn, the entire