Inércia Sensorial pressed the little lettered thingies in this order...

>   I am sorry, maybe going a little off-message here, but what would do you
> mean by eliminate 'table-scans'?
> --

What is typically referred to as a "table scan" is any operation that 
requires scanning of the entire table to get the results (i.e. querying on 
non-indexed fields).  Sometimes it isn't possible to avoid this behavior, 
but you should try to limit queries (especially on large tables) to indexed 
fields as much as possible.  For example:
Create two tables
1) with the fields "Name" and "ID" where the "ID" field is indexed
2) with the fields "ID" (ID from the previous table instead of the "Name" 
of the item) and fields for the other parameters
To query the second table for data, you create a drop-down box that 
shows users the "Name", but sends the SQL server the ID number (both 
retrieved from the first, smaller table).  The resulting query on your larger 
table is:
Which is multitudes faster (the field is indexed, therefore the SQL server 
knows exactly where to find it/them and doesn't have to sort through 
every record) than:
WHERE Name='$Name'
Where the "Name" field is not indexed (the SQL server has to search 
every record in the database for a match)

There are several cases and uses of indexes where indexing can slow 
your server down considerably, but that's WAY beyond the scope of an 
e-mail message.

If you want to find out more about that stuff, I recommend the book 
called "MySQL" by Paul DuBois.

Have fun...

Christopher Ostmo
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:

Open Source Applications:

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to