mysql>CREATETABLE d (dt DATETIME, d DATE, t TIME); Query OK, 0rows affected (0.62 sec)
mysql>CREATETABLE n (i INT, d DECIMAL, f FLOAT, dc DECIMAL); Query OK, 0rows affected (0.51 sec)
mysql>CREATETABLE s (c CHAR(25), vc VARCHAR(25), -> bn BINARY(50), vb VARBINARY(50), b BLOB, t TEXT, -> e ENUM('a', 'b', 'c'), se SET('x' ,'y', 'z')); Query OK, 0rows affected (0.50 sec)
mysql> EXPLAIN FORMAT=TREE SELECT*from d JOIN n ON d.dt = n.i\G ***************************1\. row*************************** EXPLAIN: ->Inner hash join (cast(d.dt asdouble) =cast(n.i asdouble)) (cost=0.70rows=1) ->Table scan on n (cost=0.35rows=1) -> Hash ->Table scan on d (cost=0.35rows=1)
mysql> EXPLAIN FORMAT=TREE SELECT*from s JOIN d ON d.dt = s.c\G ***************************1\. row*************************** EXPLAIN: ->Inner hash join (d.dt =cast(s.c as datetime(6))) (cost=0.72rows=1) ->Table scan on d (cost=0.37rows=1) -> Hash ->Table scan on s (cost=0.35rows=1)
1rowinset (0.01 sec)
mysql> EXPLAIN FORMAT=TREE SELECT*from n JOIN s ON n.d = s.c\G ***************************1\. row*************************** EXPLAIN: ->Inner hash join (cast(n.d asdouble) =cast(s.c asdouble)) (cost=0.70rows=1) ->Table scan on s (cost=0.35rows=1) -> Hash ->Table scan on n (cost=0.35rows=1)