On Fri, Nov 12, 2010 at 05:42:25PM +0300, Sergey Petrunya wrote:
* EXPLAIN currently shows hash join as follows:
MariaDB [hj1]> explain extended select * from t1 A, t2 B where A.a=B.a; +----+-------------+-------+------+---------------+------+---------+---------+------+-------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+---------+------+-------------------------------------+ | 1 | SIMPLE | A | ALL | NULL | NULL | NULL | NULL | 10 | Using where | | 1 | SIMPLE | B | ref | a | a | 13 | hj1.A.a | 4 | Using join buffer (flat, BNLH join) | +----+-------------+-------+------+---------------+------+---------+---------+------+-------------------------------------+
Another note about EXPLAIN: the "key" column shows name of index "a". This is purely an artifact of how currently HASH join is hooked into ref optimizer, and makes no sense from user's point of view. We need to either remove it, or make sure this is addressed in the scope of "hash join on non-indexed columns" task. BR Sergey -- Sergey Petrunia, Software Developer Monty Program AB, http://askmonty.org Blog: http://s.petrunia.net/blog