Paradox ([EMAIL PROTECTED]) writes:
> I have a table with an integer auto increment primary key, INVNUM, and a
> CHAR(48) field NAME.
>
> Is there a way I can have my table presorted by the text field, so that a
> select call with "ORDER BY NAME" is just as fast as "ORDER BY INVNUM"? I
> have tried indexing the textfield, both a few leading characters and the
> entire field, but both have no effect. The text field is not unique. The
> difference in time between these two queries is about 3 seconds:
>
> SELECT INVNUM FROM INVOICES ORDER BY INVNUM;
>
> SELECT INVNUM FROM INVOICES ORDER BY NAME;
Isn't there a way to preload the table into memory? Seems to me I saw such a thing in
the manual somewhere ... I'm not sure what else would help except to (possibly) dump,
drop, then rebuild your table with the index already on NAME - or rebuild the indexes.
--
Ed Carp, N7EKG [EMAIL PROTECTED] 940/367-2744 cell phone
http://www.pobox.com/~erc [EMAIL PROTECTED] - text pager
I sometimes wonder if the American people deserve to be free - they seem
so unwilling to fight to preserve the few freedoms they have left.
---------------------------------------------------------------------
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