At 8:20 -0500 12/15/02, David T-G wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi, all --
I think that the answer I'll get is "index", but I don't know for sure...
That's right.
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?
You don't sort the table itself, you add indexes to the tables for columns
that you're likely to use for selecting and sorting. client id number
sounds like it would be one column that you'd want to index in your
situation
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?
Yes.
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!
---------------------------------------------------------------------
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