Question: If you select and order by an indexed field, so that only the
index file is used, does the server still do a sort, or does the data come
out of the file pre-sorted?

Just wondering

Quentin

-----Original Message-----
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Friday, 23 February 2001 10:42
To: Adam C Buggia; Jason Landry
Cc: [EMAIL PROTECTED]
Subject: RE: indexing


Nope. ORDER BY determines how the result set is output.  It has nothing to
do with how MySQL finds the records.

Cal
http://www.calevans.com


-----Original Message-----
From: Adam C Buggia [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 2:53 PM
To: Jason Landry
Cc: [EMAIL PROTECTED]
Subject: Re: indexing



I do use ORDER BY by meet_hnd DESC.


In trying to optimize queries on this db, can I assume the following:

In searching for a result on meet_hnd (which is indexed) using the ORDER
BY clause not only affects the was the data is returned but also the
method by which the results are searched on:

ORDER BY ... DESC - starts from bottom
ORDER BY ... ASC - starts from top

not specifying order will result in a BDT search.

--------------------
Adam C Buggia

DirectAthletics Inc.
W: 978 927 7188
C: 781 608 5952

On Thu, 22 Feb 2001, Jason Landry wrote:

> > I am the dba for a track and field results web site, when people look
for
> > results they are most likely going to want results from a more recent
meet
> > (rather than older meets).
> >
> > there is a table result and a table meet where a column in result is
> > "meet_hnd." (there maybe hundreds of results per meet)  so I have
indexed
> > the result table on meet_hnd.  This sped things up dramatically.  Now,
the
> > I see it, though we are indexed on meet_hnd, when searching for results
> > mysql is starting at the first meet_hnd though we are most likely
wanting
> > to retrieve the last meet_hnd.  If this were indexed in reverse order
than
> > the first meet_hnd would most likely be the one we are looking for.
>
> Have you tried an ORDER BY meet_hnd DESC on your query?
>
>



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

The information contained in this email is privileged and confidential
and intended for the addressee only. If you are not the intended 
recipient, you are asked to respect that confidentiality and not 
disclose, copy or make use of its contents. If received in error 
you are asked to destroy this email and contact the sender immediately. 
Your assistance is appreciated.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to