Large Table - Indexed - Select Time
| From: | Matt Friedman | Date: | Sun, 02 Dec 2001 08:28:46 +0000 |
| Subject: | Large Table - Indexed - Select Time | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-14736@lists.php.net to get a copy of this message | ||
Say you have a table that could potentially be several thousand rows or
more (lots) and you need to do a select based on an indexed field or a
group of indexed fields.
For example, let's say the table has the following fields:
content_id pKey
object_id indexed integer field
this_id indexed integer field
another_id indexed integer field
The select might look like:
SELECT
*
FROM
theTable
WHERE
object_id = 1
AND
this_id = 2
AND
another_id = 5;
Is there a size of table where the selects would become slow? Or does
the indexing of each of the fields take care of the problem? I am
concerned about the table becoming several hundred of thousands of rows
big. I'm using mysql and/or postgresql.
Matt Friedman
Web Applications Developer
www.SpryNewMedia.com
Email: matt@SpryNewMedia.com