| 1 |
SET @global_start_value = @@global.ndb_optimized_node_selection; |
| 2 |
SELECT @global_start_value; |
| 3 |
@global_start_value |
| 4 |
3 |
| 5 |
set session ndb_optimized_node_selection=3; |
| 6 |
show variables like 'ndb_optimized_node_selection'; |
| 7 |
Variable_name Value |
| 8 |
ndb_optimized_node_selection 3 |
| 9 |
set session ndb_optimized_node_selection=0; |
| 10 |
show variables like 'ndb_optimized_node_selection'; |
| 11 |
Variable_name Value |
| 12 |
ndb_optimized_node_selection 0 |
| 13 |
set session ndb_optimized_node_selection=4; |
| 14 |
Warnings: |
| 15 |
Warning 1292 Truncated incorrect ndb_optimized_node_selection value: '4' |
| 16 |
show variables like 'ndb_optimized_node_selection'; |
| 17 |
Variable_name Value |
| 18 |
ndb_optimized_node_selection 3 |
| 19 |
set global ndb_optimized_node_selection=1; |
| 20 |
show variables like 'ndb_optimized_node_selection'; |
| 21 |
Variable_name Value |
| 22 |
ndb_optimized_node_selection 3 |
| 23 |
show variables like 'ndb_optimized_node_selection'; |
| 24 |
Variable_name Value |
| 25 |
ndb_optimized_node_selection 1 |
| 26 |
SET @@global.ndb_optimized_node_selection = @global_start_value; |
| 27 |
SELECT @@global.ndb_optimized_node_selection; |
| 28 |
@@global.ndb_optimized_node_selection |
| 29 |
3 |
| 30 |
Test behaviours within each variant |
| 31 |
create table t1 (a int primary key, b int) engine=ndb comment="NDB_TABLE=READ_BACKUP=0"; |
| 32 |
insert into t1 values (0,0), (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9); |
| 33 |
create table basecounts (node_id int primary key, transcount int) engine=innodb; |
| 34 |
set ndb_optimized_node_selection=0; |
| 35 |
show variables like 'ndb_optimized_node_selection'; |
| 36 |
Variable_name Value |
| 37 |
ndb_optimized_node_selection 0 |
| 38 |
READ PRIMARY o-n-s 0 case Hinted autocommit select by pk |
| 39 |
node_id balance |
| 40 |
1 HALF |
| 41 |
2 HALF |
| 42 |
READ PRIMARY o-n-s 0 case Unhinted table scan |
| 43 |
node_id balance |
| 44 |
1 HALF |
| 45 |
2 HALF |
| 46 |
READ PRIMARY o-n-s 0 case Autocommit update by pk |
| 47 |
node_id balance |
| 48 |
1 HALF |
| 49 |
2 HALF |
| 50 |
READ PRIMARY o-n-s 0 case Unhinted table scan on new connection |
| 51 |
node_id balance |
| 52 |
1 HALF |
| 53 |
2 HALF |
| 54 |
set ndb_optimized_node_selection=1; |
| 55 |
show variables like 'ndb_optimized_node_selection'; |
| 56 |
Variable_name Value |
| 57 |
ndb_optimized_node_selection 1 |
| 58 |
READ PRIMARY o-n-s 1 case Hinted autocommit select by pk |
| 59 |
node_id balance |
| 60 |
1 HALF |
| 61 |
2 HALF |
| 62 |
READ PRIMARY o-n-s 1 case Unhinted table scan |
| 63 |
node_id balance |
| 64 |
1 HALF |
| 65 |
2 HALF |
| 66 |
READ PRIMARY o-n-s 1 case Autocommit update by pk |
| 67 |
node_id balance |
| 68 |
1 HALF |
| 69 |
2 HALF |
| 70 |
READ PRIMARY o-n-s 1 case Unhinted table scan on new connection |
| 71 |
node_id balance |
| 72 |
1 HALF |
| 73 |
2 HALF |
| 74 |
set ndb_optimized_node_selection=2; |
| 75 |
show variables like 'ndb_optimized_node_selection'; |
| 76 |
Variable_name Value |
| 77 |
ndb_optimized_node_selection 2 |
| 78 |
READ PRIMARY o-n-s 2 case Hinted autocommit select by pk |
| 79 |
node_id balance |
| 80 |
1 NONE |
| 81 |
2 ALL |
| 82 |
READ PRIMARY o-n-s 2 case Unhinted table scan |
| 83 |
node_id balance |
| 84 |
1 HALF |
| 85 |
2 HALF |
| 86 |
READ PRIMARY o-n-s 2 case Autocommit update by pk |
| 87 |
node_id balance |
| 88 |
1 NONE |
| 89 |
2 ALL |
| 90 |
READ PRIMARY o-n-s 2 case Unhinted table scan on new connection |
| 91 |
node_id balance |
| 92 |
1 HALF |
| 93 |
2 HALF |
| 94 |
set ndb_optimized_node_selection=3; |
| 95 |
show variables like 'ndb_optimized_node_selection'; |
| 96 |
Variable_name Value |
| 97 |
ndb_optimized_node_selection 3 |
| 98 |
READ PRIMARY o-n-s 3 case Hinted autocommit select by pk |
| 99 |
node_id balance |
| 100 |
1 NONE |
| 101 |
2 ALL |
| 102 |
READ PRIMARY o-n-s 3 case Unhinted table scan |
| 103 |
node_id balance |
| 104 |
1 HALF |
| 105 |
2 HALF |
| 106 |
READ PRIMARY o-n-s 3 case Autocommit update by pk |
| 107 |
node_id balance |
| 108 |
1 NONE |
| 109 |
2 ALL |
| 110 |
READ PRIMARY o-n-s 3 case Unhinted table scan on new connection |
| 111 |
node_id balance |
| 112 |
1 HALF |
| 113 |
2 HALF |
| 114 |
drop table basecounts; |
| 115 |
drop table t1; |
| 116 |
create table t1 (a int primary key, b int) engine=ndb comment="NDB_TABLE=READ_BACKUP=1"; |
| 117 |
insert into t1 values (0,0), (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9); |
| 118 |
create table basecounts (node_id int primary key, transcount int) engine=innodb; |
| 119 |
set ndb_optimized_node_selection=0; |
| 120 |
show variables like 'ndb_optimized_node_selection'; |
| 121 |
Variable_name Value |
| 122 |
ndb_optimized_node_selection 0 |
| 123 |
READ BACKUP o-n-s 0 case Hinted autocommit select by pk |
| 124 |
node_id balance |
| 125 |
1 HALF |
| 126 |
2 HALF |
| 127 |
READ BACKUP o-n-s 0 case Unhinted table scan |
| 128 |
node_id balance |
| 129 |
1 HALF |
| 130 |
2 HALF |
| 131 |
READ BACKUP o-n-s 0 case Autocommit update by pk |
| 132 |
node_id balance |
| 133 |
1 HALF |
| 134 |
2 HALF |
| 135 |
READ BACKUP o-n-s 0 case Unhinted table scan on new connection |
| 136 |
node_id balance |
| 137 |
1 HALF |
| 138 |
2 HALF |
| 139 |
set ndb_optimized_node_selection=1; |
| 140 |
show variables like 'ndb_optimized_node_selection'; |
| 141 |
Variable_name Value |
| 142 |
ndb_optimized_node_selection 1 |
| 143 |
READ BACKUP o-n-s 1 case Hinted autocommit select by pk |
| 144 |
node_id balance |
| 145 |
1 HALF |
| 146 |
2 HALF |
| 147 |
READ BACKUP o-n-s 1 case Unhinted table scan |
| 148 |
node_id balance |
| 149 |
1 HALF |
| 150 |
2 HALF |
| 151 |
READ BACKUP o-n-s 1 case Autocommit update by pk |
| 152 |
node_id balance |
| 153 |
1 HALF |
| 154 |
2 HALF |
| 155 |
READ BACKUP o-n-s 1 case Unhinted table scan on new connection |
| 156 |
node_id balance |
| 157 |
1 HALF |
| 158 |
2 HALF |
| 159 |
set ndb_optimized_node_selection=2; |
| 160 |
show variables like 'ndb_optimized_node_selection'; |
| 161 |
Variable_name Value |
| 162 |
ndb_optimized_node_selection 2 |
| 163 |
READ BACKUP o-n-s 2 case Hinted autocommit select by pk |
| 164 |
node_id balance |
| 165 |
1 HALF |
| 166 |
2 HALF |
| 167 |
READ BACKUP o-n-s 2 case Unhinted table scan |
| 168 |
node_id balance |
| 169 |
1 HALF |
| 170 |
2 HALF |
| 171 |
READ BACKUP o-n-s 2 case Autocommit update by pk |
| 172 |
node_id balance |
| 173 |
1 HALF |
| 174 |
2 HALF |
| 175 |
READ BACKUP o-n-s 2 case Unhinted table scan on new connection |
| 176 |
node_id balance |
| 177 |
1 HALF |
| 178 |
2 HALF |
| 179 |
set ndb_optimized_node_selection=3; |
| 180 |
show variables like 'ndb_optimized_node_selection'; |
| 181 |
Variable_name Value |
| 182 |
ndb_optimized_node_selection 3 |
| 183 |
READ BACKUP o-n-s 3 case Hinted autocommit select by pk |
| 184 |
node_id balance |
| 185 |
1 HALF |
| 186 |
2 HALF |
| 187 |
READ BACKUP o-n-s 3 case Unhinted table scan |
| 188 |
node_id balance |
| 189 |
1 HALF |
| 190 |
2 HALF |
| 191 |
READ BACKUP o-n-s 3 case Autocommit update by pk |
| 192 |
node_id balance |
| 193 |
1 HALF |
| 194 |
2 HALF |
| 195 |
READ BACKUP o-n-s 3 case Unhinted table scan on new connection |
| 196 |
node_id balance |
| 197 |
1 HALF |
| 198 |
2 HALF |
| 199 |
drop table basecounts; |
| 200 |
drop table t1; |
| 201 |
create table t1 (a int primary key, b int) engine=ndb comment="NDB_TABLE=FULLY_REPLICATED=1"; |
| 202 |
insert into t1 values (0,0), (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9); |
| 203 |
create table basecounts (node_id int primary key, transcount int) engine=innodb; |
| 204 |
set ndb_optimized_node_selection=0; |
| 205 |
show variables like 'ndb_optimized_node_selection'; |
| 206 |
Variable_name Value |
| 207 |
ndb_optimized_node_selection 0 |
| 208 |
FULLY REPLICATED o-n-s 0 case Hinted autocommit select by pk |
| 209 |
node_id balance |
| 210 |
1 HALF |
| 211 |
2 HALF |
| 212 |
FULLY REPLICATED o-n-s 0 case Unhinted table scan |
| 213 |
node_id balance |
| 214 |
1 HALF |
| 215 |
2 HALF |
| 216 |
FULLY REPLICATED o-n-s 0 case Autocommit update by pk |
| 217 |
node_id balance |
| 218 |
1 HALF |
| 219 |
2 HALF |
| 220 |
FULLY REPLICATED o-n-s 0 case Unhinted table scan on new connection |
| 221 |
node_id balance |
| 222 |
1 HALF |
| 223 |
2 HALF |
| 224 |
set ndb_optimized_node_selection=1; |
| 225 |
show variables like 'ndb_optimized_node_selection'; |
| 226 |
Variable_name Value |
| 227 |
ndb_optimized_node_selection 1 |
| 228 |
FULLY REPLICATED o-n-s 1 case Hinted autocommit select by pk |
| 229 |
node_id balance |
| 230 |
1 HALF |
| 231 |
2 HALF |
| 232 |
FULLY REPLICATED o-n-s 1 case Unhinted table scan |
| 233 |
node_id balance |
| 234 |
1 HALF |
| 235 |
2 HALF |
| 236 |
FULLY REPLICATED o-n-s 1 case Autocommit update by pk |
| 237 |
node_id balance |
| 238 |
1 HALF |
| 239 |
2 HALF |
| 240 |
FULLY REPLICATED o-n-s 1 case Unhinted table scan on new connection |
| 241 |
node_id balance |
| 242 |
1 HALF |
| 243 |
2 HALF |
| 244 |
set ndb_optimized_node_selection=2; |
| 245 |
show variables like 'ndb_optimized_node_selection'; |
| 246 |
Variable_name Value |
| 247 |
ndb_optimized_node_selection 2 |
| 248 |
FULLY REPLICATED o-n-s 2 case Hinted autocommit select by pk |
| 249 |
node_id balance |
| 250 |
1 HALF |
| 251 |
2 HALF |
| 252 |
FULLY REPLICATED o-n-s 2 case Unhinted table scan |
| 253 |
node_id balance |
| 254 |
1 HALF |
| 255 |
2 HALF |
| 256 |
FULLY REPLICATED o-n-s 2 case Autocommit update by pk |
| 257 |
node_id balance |
| 258 |
1 HALF |
| 259 |
2 HALF |
| 260 |
FULLY REPLICATED o-n-s 2 case Unhinted table scan on new connection |
| 261 |
node_id balance |
| 262 |
1 HALF |
| 263 |
2 HALF |
| 264 |
set ndb_optimized_node_selection=3; |
| 265 |
show variables like 'ndb_optimized_node_selection'; |
| 266 |
Variable_name Value |
| 267 |
ndb_optimized_node_selection 3 |
| 268 |
FULLY REPLICATED o-n-s 3 case Hinted autocommit select by pk |
| 269 |
node_id balance |
| 270 |
1 HALF |
| 271 |
2 HALF |
| 272 |
FULLY REPLICATED o-n-s 3 case Unhinted table scan |
| 273 |
node_id balance |
| 274 |
1 HALF |
| 275 |
2 HALF |
| 276 |
FULLY REPLICATED o-n-s 3 case Autocommit update by pk |
| 277 |
node_id balance |
| 278 |
1 HALF |
| 279 |
2 HALF |
| 280 |
FULLY REPLICATED o-n-s 3 case Unhinted table scan on new connection |
| 281 |
node_id balance |
| 282 |
1 HALF |
| 283 |
2 HALF |
| 284 |
drop table basecounts; |
| 285 |
drop table t1; |