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

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

On Sun, 10 Nov 2002 13:46:33 -0500 "Chris Payne" <[EMAIL PROTECTED]> 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 (
> To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to