In MySQL 4.1.11, if you create two temporary tables with non-unique indices as 
part of the CREATE TEMPORARY TABLE statement, then
insert several hundred (or thousand) rows, a subsequent SELECT using a JOIN 
between the two tables is substantially slower than if
you create the indices after inserting the rows into the temporary tables.  
When I run a SHOW INDEX for these tables, the only
difference is the Cardinality field, where it is NULL if the index was created 
prior to any inserts and is a number if the index was
created after the inserts.

Why is it that adding an index before or after the addition of data makes a 
difference on SELECT performance?

Allan Miller




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to