Re[2]: [PHP-DB] Optimising LIMITs
| From: | Richard Davey | Date: | Mon, 01 Mar 2004 18:28:49 +0000 |
| Subject: | Re[2]: [PHP-DB] Optimising LIMITs | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-33241@lists.php.net to get a copy of this message | ||
Hello Jeffrey,
Monday, March 1, 2004, 5:27:41 PM, you wrote:
JM> Primary keys aren't any faster than normal keys. They're simply for
JM> identification. (correct me if I'm wrong, that is my understanding)
JM> If you don't already have an index on created, I'd do that.
I do - here's a question though, what is the best way to have an
index? To combine multiple fields into one index - or to have one
field per index? I ask because MySQL will appear to select the best
possible index for the query and sometimes it's wrong - I read
somewhere you can control which index it uses, but if you had a
"combined" index would this make things any more/less effective?
JM> If you want to optimize things further, I would run the query at midnight
JM> each morning, and instead of paging through the entire table, just page
JM> through that temporary table.
Figured someone might suggest that - I will have to look into it.
Thanks.
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html