> If you have separate indexes on ssn and id_num, MySQL may be able to
> efficiently use an index merge optimization .   See
> http://dev.mysql.com/doc/refman/5.0/en/index-merge-optimization.html.
> This is only in 5.0+ - on older versions of MySQL you may find a union
> more efficient.

And in newer versions, too.  The optimizer frequently underestimates
the cost of the merge operation and the required random I/O for row
lookups.  So, yes it can "use" an index merge, but... efficiency is
another question.  I've seen table scans outperform a two-way index
merge by orders of magnitude.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to