Re: Optimizing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux