David, Your reference to "having the table sorted" suggests physical table sorting, but a basic characteristic of a relational DBMS is that data retrieval does not depend on physical row order. The actual order of rows in a MySql table is entirely arbitrary, and shouldn't be your concern except perhaps for huge OLAP tables.
So I think the question you are asking comes down to this: when does an index provide a performance advantage? One answer is: when the rows you are retrieving form a very small subset of the table you are querying, the effect of the index then vbeing to greatly diminish the number of rows that have to be physically read to return the desired result set. PB ----- > I think that the answer I'll get is "index", but I don't know for sure... > > If I have a table with fields such as a client id number and a credit > card id number, where a given client might have multiple cards on file, > when I select from the table do I care about having the table sorted so > that I can go to the client id number, get all of the ccard id numbers, > and then know that I'm done when the client id number changes, or does it > not matter and I just select from the whole table and get the limited > results back? > > If I had to write this myself, I'd probably base the decision to keep the > table sorted on the number of reads vs the number of writes, since I'd > have to rewrite at least some of the table whenever I added a client > card. This is a database, though, where that's all handled for me :-) > > Is sorting and speed a consideration when making a select request? Is > that the sort of thing where an index will speed things up? > > > TIA & HAND > > mysql query, > :-D > - -- > David T-G * There is too much animal courage in > (play) [EMAIL PROTECTED] * society and not sufficient moral courage. > (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" > http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.7 (FreeBSD) > > iD8DBQE9/IGkGb7uCXufRwARAlTIAJ9DHVOm+yTIUVBPJ1G4Cjig3+SApQCgomBJ > 0WhZJNmG2I05Vq1be3fkIiE= > =Kq7s > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > 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