replies below:


""M. Verheijen"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
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 always work on the theory that i index columns that i use in the select
section of a query, or a where.
keys will be indexed automatically (AFAIU).
the speed increase will be dramatic. i used postgres and didn't index a
field (accidently) and then ran queries.then indexed it and the speed
increase is huge.
as for making indexes it depends what tools you use. most tools such as
mysql-admin etcc will let you create indexes by a pointy clicky interface.
true purists might insist on:

CREATE [UNIQUE] INDEX index_name ON table [USING acc_name]

from the sql command line.

<<<<<<<<<<<<<<<<<<<

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.

>>>>>>>>>>>>>>>>>>>>
i don't think you need to get into what particular type of index it is
(hash, etc) but they are generally a good thing.
<<<<<<<<<<<<<<<<<<<<<<

Yes, I know a long list of questions ;) I hope that some of you can give me
a clue or two.

>>>>>>>>>>>>>>>>>>>>>>>
log lists of questions are a good thing and should be warmly welcomed by
everyone.
<<<<<<<<<<<<<<<<<<<<<<<


With best regards,
Maarten Verheijen


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
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