-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Iain Lang wrote:
.
But that is my question! *When* do they provide a performance difference?
Obviously my (fairly simple) question ("...and beyond what number of records might indices provide faster extraction/presentation?... ) has not been understood. Can anyone else help, please?

At 11:22 22/12/02 +1100, Alan McDonald wrote:

You need indexes as soon as (or rather just before) they provide a
performance difference.
From http://www.mysql.com/doc/en/Where_optimisations.html :

"Each table index is queried, and the best index that spans fewer than 30% of the rows is used. If no such index can be found, a quick table scan is used.".

So if you can't create an index that will have values that will cause MySQL to look at less that 30% of the rows, it will not be used. For example if you have a column that contains the value 'foo' 90% of the time, queries looking for 'foo' in that column will not use an index.

Indexes almost _always_ slow down data _modification_. You can tell when/if they speed-up data retrieval by using the 'EXPLAIN' command in MySQL, see:

http://www.mysql.com/doc/en/EXPLAIN.html


-Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+BcGPtvXNTca6JD8RAjAmAKC/OlCFFx7iLZN57AMIRO5cV4wfyACgrLjU
OHViqL0GR0Hf4lLoS50uTXU=
=veUT
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to