From: Ole John Aske Date: October 16 2010 9:22am Subject: bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3316) List-Archive: http://lists.mysql.com/commits/120882 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1849356481==" --===============1849356481== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///home/oleja/mysql/mysql-5.1-telco-7.0-spj-scan-scan/ based on revid:ole.john.aske@stripped 3316 Ole John Aske 2010-10-16 [merge] Merge from 7.0-spj branch modified: sql/sql_select.cc === modified file 'sql/sql_select.cc' --- a/sql/sql_select.cc 2010-10-15 21:04:14 +0000 +++ b/sql/sql_select.cc 2010-10-16 09:22:02 +0000 @@ -116,17 +116,9 @@ static void reset_nj_counters(List *join_list, uint first_unused); -/** - * SPJ MERGE TODO Bug#48971: - * BEWARE: Temp fix for Bug#48971 in SPJ branch affects signature - * to optimize_cond. - * Permanent fix has not been merged to this branch yet. - * Needed as this was a showstopper for further SPJ testing. - */ static COND *optimize_cond(JOIN *join, COND *conds, List *join_list, - Item::cond_result *cond_value, - bool build_equalites); + Item::cond_result *cond_value); static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item); static bool open_tmp_table(TABLE *table); static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, @@ -894,7 +886,7 @@ JOIN::optimize() thd->restore_active_arena(arena, &backup); } - conds= optimize_cond(this, conds, join_list, &cond_value, TRUE); + conds= optimize_cond(this, conds, join_list, &cond_value); if (thd->is_error()) { error= 1; @@ -903,7 +895,7 @@ JOIN::optimize() } { - having= optimize_cond(this, having, join_list, &having_value, FALSE); + having= optimize_cond(this, having, join_list, &having_value); if (thd->is_error()) { error= 1; @@ -9267,39 +9259,6 @@ static bool check_interleaving_with_nj(J function for the first table in join order (for which check_interleaving_with_nj has not been called) - The algorithm is the reciprocal of check_interleaving_with_nj(), hence - parent join nest nodes are updated only when the last table in its child - node is removed. The ASCII graphic below will clarify. - - %A table nesting such as t1 x [ ( t2 x t3 ) x ( t4 x t5 ) ] is - represented by the below join nest tree. - - @verbatim - NJ1 - _/ / \ - _/ / NJ2 - _/ / / \ - / / / \ - t1 x [ (t2 x t3) x (t4 x t5) ] - @endverbatim - - At the point in time when check_interleaving_with_nj() adds the table t5 to - the query execution plan, QEP, it also directs the node named NJ2 to mark - the table as covered. NJ2 does so by incrementing its @c counter - member. Since all of NJ2's tables are now covered by the QEP, the algorithm - proceeds up the tree to NJ1, incrementing its counter as well. All join - nests are now completely covered by the QEP. - - restore_prev_nj_state() does the above in reverse. As seen above, the node - NJ1 contains the nodes t2, t3, and NJ2. Its counter being equal to 3 means - that the plan covers t2, t3, and NJ2, @e and that the sub-plan (t4 x t5) - completely covers NJ2. The removal of t5 from the partial plan will first - decrement NJ2's counter to 1. It will then detect that NJ2 went from being - completely to partially covered, and hence the algorithm must continue - upwards to NJ1 and decrement its counter to 2. %A subsequent removal of t4 - will however not influence NJ1 since it did not un-cover the last table in - NJ2. - @param last join table to remove, it is assumed to be the last in current partial join order. */ @@ -9326,16 +9285,9 @@ static void restore_prev_nj_state(JOIN_T } -/** - * SPJ MERGE TODO Bug#48971: - * BEWARE: Temp fix for Bug#48971 in SPJ branch affects signature - * to optimize_cond. - * Permanent fix has not been merged to this branch yet. - * Needed as this was a showstopper for further SPJ testing. - */ static COND * optimize_cond(JOIN *join, COND *conds, List *join_list, - Item::cond_result *cond_value, bool build_equalites) + Item::cond_result *cond_value) { THD *thd= join->thd; DBUG_ENTER("optimize_cond"); @@ -9353,12 +9305,9 @@ optimize_cond(JOIN *join, COND *conds, L multiple equality contains a constant. */ DBUG_EXECUTE("where", print_where(conds, "original", QT_ORDINARY);); - if (build_equalites) - { - conds= build_equal_items(join->thd, conds, NULL, join_list, - &join->cond_equal); - DBUG_EXECUTE("where",print_where(conds,"after equal_items",QT_ORDINARY);); - } + conds= build_equal_items(join->thd, conds, NULL, join_list, + &join->cond_equal); + DBUG_EXECUTE("where",print_where(conds,"after equal_items",QT_ORDINARY);); /* change field = field to field = const for each found field = const */ propagate_cond_constants(thd, (I_List *) 0, conds, conds); --===============1849356481== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/ole.john.aske@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: ole.john.aske@stripped\ # z2iptfmsezw6bjt9 # target_branch: file:///home/oleja/mysql/mysql-5.1-telco-7.0-spj-\ # scan-scan/ # testament_sha1: f8579e44ea9acdad4ba3e373c72cd8e4665fc203 # timestamp: 2010-10-16 11:22:18 +0200 # source_branch: bzr+ssh://oaske@stripped/bzrroot/server\ # /mysql-5.1-telco-7.0-spj/ # base_revision_id: ole.john.aske@stripped\ # qg1paejjbtj3tza0 # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWYMKJPwAA6x/gEAwACBRd/// fre2YL////BgBxwr7oJEUrpnNqFVQKOGppA1MgGQGjTagAaAAADJkBJIEm0NAmqbRqeoyaT81RPK eKaehBkYgYOYAjBMQDAJgmjIaGATBGJhKECEUfpTT/U1T9U3ooyehPRoAARsJihkOYAjBMQDAJgm jIaGATBGJgqigjBDTJMRT8RU9hMmVHinqaepkaNGmj1NK4I9475YjdUi19X6PQ7cQuIuWUrxNUGk VLjv1pdU0nMF19kxUsiQjGS43EBqIvePfrqAK1IITZsBg2ErTw3oMMqKohqzgSc8gMNOdbggqOm9 z4FFranjECdj6ahRsMbyuFseyH7MBhYnb/dWfj0RKNtJr9gdBLnIxw6iwIXlZYaWDGVpQBqA4DNN 2leCQkKBLz6G8G4hGOFyIZrTk7aHUzHfhT8321SLkooU8l2L9SYWBlEYHs8W8lgoQ5PeeFfcvjF3 nJ6I/X0jujVZKUxCoLnELJhC3KFHuc7OcUhm9bAzMy8thaeUVajYS8ZEVmiEIoRTRQk0yeP6l6+p w+hTfddSigrGiE+08eTWrdqE4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