At 8:20 -0500 12/15/02, David T-G wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hi, all --
>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
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
>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
>David T-G * There is too much animal courage in
>(play) davidtg@stripped * society and not sufficient moral courage.
>(work) davidtgwork@stripped -- Mary Baker Eddy, "Science and Health"
>http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!