Indexing help

From: Date: Tue, 27 Mar 2001 08:32:01 +0000
Subject: Indexing help
Groups: php.db 
Request: Send a blank email to php-db+get-7858@lists.php.net to get a copy of this message
Dear reader, A newbie mysql/php-question here! I've filled a mysql-database with about 1600 records. All these records contain items which are on sale on a website. Every row contains an integer defining the category to which a item belongs. At the left of the website there are buttons linked to a php-page which does a selection like this: select * from PRODUCTS where SUBCODE = \"$SUBCODE\" As you might have guessed, every button is a link in the form of: <a href="products.php?SUBCODE=8"><img src="../button2.gif" border="0"></a> This all works well, but now my questions! Is it wise to make an index for the integer column? I assume it is because it's the row almost all queries are using in there where-statements. What kind of speed increase can I expect, will it increase the speed of query's if the workload goes to 2000 queries a hour? What's the best way to make this index, how does it works. I've read about the use of indexes in the mysql-manual and phpbuilder.net, but both are kind of short and don't tell what you're doing exactly. Anybody of you have some pointers to good webresources about indexing. Yes, I know a long list of questions ;) I hope that some of you can give me a clue or two. With best regards, Maarten Verheijen

« previous php.db (#7858) next »