|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Baron Schwartz (baron
xaprb.com)
Date: Tue Jan 13 2009 - 19:07:34 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> 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
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]