Re: Optimizing
| From: | Maxim Maletsky | Date: | Sun, 10 Nov 2002 23:48:28 +0000 |
| Subject: | Re: Optimizing | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23198@lists.php.net to get a copy of this message | ||
You should index everything that is used in WHERE, ORDER and GROUP
clauses. Means, if your queries do
SELECT * FROM people WHERE name='maxim';
you should add an index on name field. Also, if you do something like
this:
SELECT * FROM people WHERE name='maxim' ORDER BY surname;
then you better add an index on both of them, and, if this is the most
common (heaviest) query for you do it together sequentially:
(name, surname)
I hope you get the idea.
--
Maxim Maletsky
maxim@php.net
On Sun, 10 Nov 2002 13:46:33 -0500 "Chris Payne" <chris@planetoxygene.com> wrote:
> Hi there everyone,
>
> How does indexing work, and does it speed up small / average size DB's of
> around 20,000 records, with 12 columns per record? (Some columns being
> paragraphs of text).
>
> Also, do you create an index on everything or just 1 item or or or :-)
>
> I've not looked at indexing but think it's time to start, but in a way even
> I can understand so I thought i'd ask you all here :-)
>
> Thanks
>
> Chris
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>