On 6/3/07, David Krings <[EMAIL PROTECTED]> wrote:

Adrian Noland wrote:
> The key to speedy SQL is in the indexes. Without an index the SQL engine
> iterates over every row. With an index it automagically grabs the
> correct value.

This is really an eyeopener. After indexing all those columns that come
up in some selects running the same query that took over 30 minutes
(that's when I hit the reset button) now takes 26 seconds.

This is plain awesome! Thanks for making me less dumb.

David


When it comes to choosing which columns to index, you want to pick something
with a high cardinality, or, for lack of a better term, "uniqueablity".
Gender wont have a high cardinality because there are only 2 choices for
many records. Last name on your personal family address book will have a low
cardinality because of family members sharing last name. A key of last name
+ first name will have a high cardinality and will make a good index.
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to