Merge lp:~stewart/percona-server/5.5-bug986247-remove-optimizer-fix into lp:percona-server/5.5

Proposed by Stewart Smith
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 418
Proposed branch: lp:~stewart/percona-server/5.5-bug986247-remove-optimizer-fix
Merge into: lp:percona-server/5.5
Diff against target: 146 lines (+8/-38)
5 files modified
Percona-Server/mysql-test/r/select.result (+2/-2)
Percona-Server/patch_info/optimizer_fix.info (+0/-8)
Percona-Server/sql/opt_range.cc (+4/-22)
Percona-Server/sql/sql_select.cc (+0/-5)
Percona-Server/sql/sys_vars.cc (+2/-1)
To merge this branch: bzr merge lp:~stewart/percona-server/5.5-bug986247-remove-optimizer-fix
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
George Ormond Lorch III (community) g2 Approve
Review via email: mp+138908@code.launchpad.net

Description of the change

Remove optimizer_fix in 5.5, based on 5.5 patch that was imported into BZR (not the 5.1 one).

http://jenkins.percona.com/view/PS%205.5/job/percona-server-5.5-param/602/

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) :
review: Approve (g2)
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve
Revision history for this message
Stewart Smith (stewart) wrote :

Actually causes this test failure:
CURRENT_TEST: main.select
--- /home/jenkins/workspace/merge-PS-5.5-staging/BUILD_TYPE/release/Host/debian6-32/Percona-Server/mysql-test/r/select.result 2013-01-08 04:07:21.279947000 +0300
+++ /home/jenkins/workspace/merge-PS-5.5-staging/BUILD_TYPE/release/Host/debian6-32/Percona-Server/mysql-test/r/select.reject 2013-01-11 04:04:48.267403445 +0300
@@ -2196,10 +2196,10 @@
 select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1;
 a a
 1 2
-1 3
 2 2
-2 3
 3 2
+1 3
+2 3
 3 3
 select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
 a a

mysqltest: Result content mismatch

Which is the inverse of this revision:

        revno: 0.16401.242
        revision-id: <email address hidden>
        parent: <email address hidden>
        committer: Stewart Smith <email address hidden>
        branch nick: percona-server-5.1
        timestamp: Thu 2011-11-24 13:00:56 +1100
        message:
          Import Percona Server patch: mysql-test.diff
        diff:
        === modified file 'Percona-Server/mysql-test/r/select.result'
        --- Percona-Server/mysql-test/r/select.result 2010-06-24 08:00:48 +0000
        +++ Percona-Server/mysql-test/r/select.result 2011-11-24 02:00:56 +0000
        @@ -2196,10 +2196,10 @@
         select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1;
         a a
         1 2
        +1 3
         2 2
        +2 3
         3 2
        -1 3
        -2 3
         3 3
         select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/mysql-test/r/select.result'
2--- Percona-Server/mysql-test/r/select.result 2012-06-05 10:36:15 +0000
3+++ Percona-Server/mysql-test/r/select.result 2013-02-06 01:21:25 +0000
4@@ -2196,10 +2196,10 @@
5 select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1;
6 a a
7 1 2
8+2 2
9+3 2
10 1 3
11-2 2
12 2 3
13-3 2
14 3 3
15 select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
16 a a
17
18=== removed file 'Percona-Server/patch_info/optimizer_fix.info'
19--- Percona-Server/patch_info/optimizer_fix.info 2012-04-18 23:24:38 +0000
20+++ Percona-Server/patch_info/optimizer_fix.info 1970-01-01 00:00:00 +0000
21@@ -1,8 +0,0 @@
22-File=optimizer_fix.patch
23-Name=Unofficial optimizer fixes
24-Version=1.0
25-Author=Percona <info@percona.com>
26-License=GPL
27-Comment=
28-2010-01
29-Ported to 5.1.42
30
31=== modified file 'Percona-Server/sql/opt_range.cc'
32--- Percona-Server/sql/opt_range.cc 2013-01-09 23:45:25 +0000
33+++ Percona-Server/sql/opt_range.cc 2013-02-06 01:21:25 +0000
34@@ -728,7 +728,7 @@
35 static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
36 bool index_read_must_be_used,
37 bool update_tbl_stats,
38- double read_time, ha_rows *estimated_records);
39+ double read_time);
40 static
41 TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree,
42 double read_time,
43@@ -2154,7 +2154,6 @@
44 ha_rows limit, bool force_quick_range)
45 {
46 uint idx;
47- ha_rows estimated_records=0;
48 double scan_time;
49 DBUG_ENTER("SQL_SELECT::test_quick_select");
50 DBUG_PRINT("enter",("keys_to_use: %lu prev_tables: %lu const_tables: %lu",
51@@ -2323,17 +2322,12 @@
52
53 /* Get best 'range' plan and prepare data for making other plans */
54 if ((range_trp= get_key_scans_params(&param, tree, FALSE, TRUE,
55- best_read_time, &estimated_records)))
56+ best_read_time)))
57 {
58 best_trp= range_trp;
59 best_read_time= best_trp->read_cost;
60 }
61
62- if (opt_optimizer_fix && estimated_records)
63- {
64- records = estimated_records;
65- }
66-
67 /*
68 Simultaneous key scans and row deletes on several handler
69 objects are not allowed so don't use ROR-intersection for
70@@ -3837,7 +3831,7 @@
71 {
72 DBUG_EXECUTE("info", print_sel_tree(param, *ptree, &(*ptree)->keys_map,
73 "tree in SEL_IMERGE"););
74- if (!(*cur_child= get_key_scans_params(param, *ptree, TRUE, FALSE, read_time, NULL)))
75+ if (!(*cur_child= get_key_scans_params(param, *ptree, TRUE, FALSE, read_time)))
76 {
77 /*
78 One of index scans in this index_merge is more expensive than entire
79@@ -4940,12 +4934,11 @@
80 static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
81 bool index_read_must_be_used,
82 bool update_tbl_stats,
83- double read_time, ha_rows *estimated_records)
84+ double read_time)
85 {
86 int idx;
87 SEL_ARG **key,**end, **key_to_read= NULL;
88 ha_rows UNINIT_VAR(best_records); /* protected by key_to_read */
89- ha_rows min_records= HA_POS_ERROR;
90 TRP_RANGE* read_plan= NULL;
91 bool pk_is_clustered= param->table->file->primary_key_is_clustered();
92 DBUG_ENTER("get_key_scans_params");
93@@ -5016,11 +5009,6 @@
94 key_to_read= key;
95 }
96
97- if (estimated_records && found_records
98- && min_records > found_records)
99- {
100- min_records = found_records;
101- }
102 }
103 }
104
105@@ -5043,12 +5031,6 @@
106 else
107 DBUG_PRINT("info", ("No 'range' table read plan found"));
108
109- /* minimum number of records (not 0) as estimated number of records */
110- if (estimated_records && min_records != HA_POS_ERROR)
111- {
112- *estimated_records = min_records;
113- }
114-
115 DBUG_RETURN(read_plan);
116 }
117
118
119=== modified file 'Percona-Server/sql/sql_select.cc'
120--- Percona-Server/sql/sql_select.cc 2013-01-17 22:50:22 +0000
121+++ Percona-Server/sql/sql_select.cc 2013-02-06 01:21:25 +0000
122@@ -2652,11 +2652,6 @@
123 table->reginfo.impossible_range=1;
124 DBUG_RETURN(0);
125 }
126- if (opt_optimizer_fix && error == 0)
127- {
128- /* quick select is not effective. but the estimated value is used. */
129- DBUG_RETURN(select->records);
130- }
131 DBUG_PRINT("warning",("Couldn't use record count on const keypart"));
132 }
133 DBUG_RETURN(HA_POS_ERROR); /* This shouldn't happend */
134
135=== modified file 'Percona-Server/sql/sys_vars.cc'
136--- Percona-Server/sql/sys_vars.cc 2012-10-17 03:47:45 +0000
137+++ Percona-Server/sql/sys_vars.cc 2013-02-06 01:21:25 +0000
138@@ -2364,7 +2364,8 @@
139
140 static Sys_var_mybool Sys_optimizer_fix(
141 "optimizer_fix",
142- "Enable unofficial optimizer fixes.",
143+ "OBSOLETE: only here for compatibility with old Percona Server "
144+ "releases, does nothing.",
145 GLOBAL_VAR(opt_optimizer_fix),
146 NO_CMD_LINE, DEFAULT(TRUE));
147

Subscribers

People subscribed via source and target branches