Hi!
"Sergey" == Sergey Petrunya <psergey@askmonty.org> writes:
Sergey> Hello, Sergey> When coding MWL#182, I've found out that it is very difficult to print Sergey> the same value of select_type as EXPLAIN does. <cut> Sergey> Future solution #1: get rid of SIMPLE Sergey> ------------------------------------- Sergey> I don't see a value of having select_type=SIMPLE (other than term "simple" Sergey> being encouraging for novice users:) We could change SIMPLE to PRIMARY Sergey> everywhere and get rid of the problem Sergey> Future solution #2: use SIMPLE/PRIMARY approach of SHOW EXPLAIN Sergey> --------------------------------------------------------------- Sergey> EXPLAIN SELECT produces incorrect values because it calls Sergey> st_select_lex::set_explain_type() before the query rewrites are done, so Sergey> it can't see that Sergey> - used VIEWs have subqueries Sergey> - used subqueries will be flattened Sergey> - etc. Sergey> SHOW EXPLAIN operates on a query that is being executed, and that alone Sergey> guarantees its output is closer to reality. This means, EXPLAIN SELECT output Sergey> must be changed to match SHOW EXPLAIN output. This is a lot of changes Sergey> across a number of .result files. It don't think it's a big problem if 'show explain' have a slightly different result than 'explain select' for the time being (if it's more correct). Regards, Monty