Igor Babaev
2b1f0b8757
Back-ported the patch of the mysql-5.6 code line that
...
fixed several defects in the greedy optimization:
1) The greedy optimizer calculated the 'compare-cost' (CPU-cost)
for iterating over the partial plan result at each level in
the query plan as 'record_count / (double) TIME_FOR_COMPARE'
This cost was only used locally for 'best' calculation at each
level, and *not* accumulated into the total cost for the query plan.
This fix added the 'CPU-cost' of processing 'current_record_count'
records at each level to 'current_read_time' *before* it is used as
'accumulated cost' argument to recursive
best_extension_by_limited_search() calls. This ensured that the
cost of a huge join-fanout early in the QEP was correctly
reflected in the cost of the final QEP.
To get identical cost for a 'best' optimized query and a
straight_join with the same join order, the same change was also
applied to optimize_straight_join() and get_partial_join_cost()
2) Furthermore to get equal cost for 'best' optimized query and a
straight_join the new code substrcated the same '0.001' in
optimize_straight_join() as it had been already done in
best_extension_by_limited_search()
3) When best_extension_by_limited_search() aggregated the 'best' plan a
plan was 'best' by the check :
'if ((search_depth == 1) || (current_read_time < join->best_read))'
The term '(search_depth == 1' incorrectly caused a new best plan to be
collected whenever the specified 'search_depth' was reached - even if
this partial query plan was more expensive than what we had already
found.
2011-12-24 08:55:10 -08:00
..
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-08-17 17:57:58 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2010-08-02 19:39:45 +03:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-10-07 20:56:11 +04:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2010-08-02 19:39:45 +03:00
2009-10-26 13:35:42 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-08-17 17:57:58 +02:00
2011-11-26 14:23:00 -08:00
2009-04-02 12:03:14 +02:00
2011-12-15 14:26:59 -08:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2011-11-24 16:04:19 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2011-12-15 00:21:15 -08:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2011-12-15 00:21:15 -08:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2011-06-12 11:28:22 +02:00
2009-11-24 11:19:08 +01:00
2011-12-15 14:26:59 -08:00
2011-12-15 00:21:15 -08:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2011-12-15 00:21:15 -08:00
2011-12-15 00:21:15 -08:00
2011-12-15 00:21:15 -08:00
2011-02-23 11:22:56 +02:00
2011-09-30 18:55:02 -07:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2011-09-15 10:36:17 +03:00
2011-01-04 00:55:41 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-08-31 13:07:44 +02:00
2009-04-02 12:03:14 +02:00
2009-08-31 13:07:44 +02:00
2009-04-02 12:03:14 +02:00
2009-08-31 13:07:44 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2010-04-07 01:47:08 +03:00
2009-04-02 12:03:14 +02:00
2009-10-28 16:56:07 +02:00
2009-04-02 12:03:14 +02:00
2011-06-12 11:28:22 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-08-17 17:57:58 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2010-03-09 16:03:54 +01:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-12-22 11:33:20 +01:00
2009-12-22 11:33:20 +01:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-12-22 11:33:20 +01:00
2009-04-02 12:03:14 +02:00
2011-03-31 14:29:23 +02:00
2010-07-01 23:50:18 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-12-22 11:33:20 +01:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-11-24 11:19:08 +01:00
2011-05-05 23:28:42 +03:00
2009-04-02 12:03:14 +02:00
2009-08-17 17:57:58 +02:00
2010-08-02 19:39:45 +03:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-08-17 17:57:58 +02:00
2009-04-02 12:03:14 +02:00
2010-05-15 09:14:47 +02:00
2011-12-15 00:21:15 -08:00
2009-04-02 12:03:14 +02:00
2010-08-06 15:39:37 +03:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2010-04-07 18:26:30 +03:00
2011-12-24 08:55:10 -08:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-08-17 17:57:58 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2011-05-28 05:11:32 +03:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2010-06-10 11:11:52 +02:00
2011-12-15 00:21:15 -08:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 12:03:14 +02:00
2009-04-02 22:36:52 +02:00