| 1 |
set global innodb_stats_method = default; |
| 2 |
select @@innodb_stats_method; |
| 3 |
@@innodb_stats_method |
| 4 |
nulls_equal |
| 5 |
select count(*) from bug30243_3 where org_id is not NULL; |
| 6 |
count(*) |
| 7 |
20 |
| 8 |
select count(*) from bug30243_3 where org_id is NULL; |
| 9 |
count(*) |
| 10 |
16384 |
| 11 |
select count(*) from bug30243_2 where org_id is not NULL; |
| 12 |
count(*) |
| 13 |
224 |
| 14 |
select count(*) from bug30243_2 where org_id is NULL; |
| 15 |
count(*) |
| 16 |
65536 |
| 17 |
select @@innodb_stats_method; |
| 18 |
@@innodb_stats_method |
| 19 |
nulls_equal |
| 20 |
analyze table bug30243_1; |
| 21 |
Table Op Msg_type Msg_text |
| 22 |
test.bug30243_1 analyze status OK |
| 23 |
analyze table bug30243_2; |
| 24 |
Table Op Msg_type Msg_text |
| 25 |
test.bug30243_2 analyze status OK |
| 26 |
analyze table bug30243_3; |
| 27 |
Table Op Msg_type Msg_text |
| 28 |
test.bug30243_3 analyze status OK |
| 29 |
set global innodb_stats_method = "NULL"; |
| 30 |
ERROR 42000: Variable 'innodb_stats_method' can't be set to the value of 'NULL' |
| 31 |
set global innodb_stats_method = "nulls_ignored"; |
| 32 |
select @@innodb_stats_method; |
| 33 |
@@innodb_stats_method |
| 34 |
nulls_ignored |
| 35 |
analyze table bug30243_1; |
| 36 |
Table Op Msg_type Msg_text |
| 37 |
test.bug30243_1 analyze status OK |
| 38 |
analyze table bug30243_2; |
| 39 |
Table Op Msg_type Msg_text |
| 40 |
test.bug30243_2 analyze status OK |
| 41 |
analyze table bug30243_3; |
| 42 |
Table Op Msg_type Msg_text |
| 43 |
test.bug30243_3 analyze status OK |
| 44 |
explain SELECT COUNT(*), 0 |
| 45 |
FROM bug30243_1 orgs |
| 46 |
LEFT JOIN bug30243_3 sa_opportunities |
| 47 |
ON orgs.org_id=sa_opportunities.org_id |
| 48 |
LEFT JOIN bug30243_2 contacts |
| 49 |
ON orgs.org_id=contacts.org_id ; |
| 50 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 51 |
1 SIMPLE orgs NULL index NULL org_id 4 NULL ROWS 100.00 Using index |
| 52 |
1 SIMPLE sa_opportunities NULL ref org_id org_id 5 test.orgs.org_id ROWS 100.00 Using index |
| 53 |
1 SIMPLE contacts NULL ref contacts$org_id contacts$org_id 5 test.orgs.org_id ROWS 100.00 Using index |
| 54 |
Warnings: |
| 55 |
Note 1003 /* select#1 */ select count(0) AS `COUNT(*)`,0 AS `0` from `test`.`bug30243_1` `orgs` left join `test`.`bug30243_3` `sa_opportunities` on((`test`.`sa_opportunities`.`org_id` = `test`.`orgs`.`org_id`)) left join `test`.`bug30243_2` `contacts` on((`test`.`contacts`.`org_id` = `test`.`orgs`.`org_id`)) where true |
| 56 |
select @@innodb_stats_method; |
| 57 |
@@innodb_stats_method |
| 58 |
nulls_ignored |
| 59 |
set global innodb_stats_method = "nulls_unequal"; |
| 60 |
select @@innodb_stats_method; |
| 61 |
@@innodb_stats_method |
| 62 |
nulls_unequal |
| 63 |
analyze table bug30243_1; |
| 64 |
Table Op Msg_type Msg_text |
| 65 |
test.bug30243_1 analyze status OK |
| 66 |
analyze table bug30243_2; |
| 67 |
Table Op Msg_type Msg_text |
| 68 |
test.bug30243_2 analyze status OK |
| 69 |
analyze table bug30243_3; |
| 70 |
Table Op Msg_type Msg_text |
| 71 |
test.bug30243_3 analyze status OK |
| 72 |
explain SELECT COUNT(*), 0 |
| 73 |
FROM bug30243_1 orgs |
| 74 |
LEFT JOIN bug30243_3 sa_opportunities |
| 75 |
ON orgs.org_id=sa_opportunities.org_id |
| 76 |
LEFT JOIN bug30243_2 contacts |
| 77 |
ON orgs.org_id=contacts.org_id; |
| 78 |
id select_type table partitions type possible_keys key key_len ref rows filtered Extra |
| 79 |
1 SIMPLE orgs NULL index NULL org_id 4 NULL ROWS 100.00 Using index |
| 80 |
1 SIMPLE sa_opportunities NULL ref org_id org_id 5 test.orgs.org_id ROWS 100.00 Using index |
| 81 |
1 SIMPLE contacts NULL ref contacts$org_id contacts$org_id 5 test.orgs.org_id ROWS 100.00 Using index |
| 82 |
Warnings: |
| 83 |
Note 1003 /* select#1 */ select count(0) AS `COUNT(*)`,0 AS `0` from `test`.`bug30243_1` `orgs` left join `test`.`bug30243_3` `sa_opportunities` on((`test`.`sa_opportunities`.`org_id` = `test`.`orgs`.`org_id`)) left join `test`.`bug30243_2` `contacts` on((`test`.`contacts`.`org_id` = `test`.`orgs`.`org_id`)) where true |
| 84 |
Warnings: |
| 85 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 86 |
SELECT COUNT(*) FROM table_bug30423 WHERE org_id IS NULL; |
| 87 |
COUNT(*) |
| 88 |
1024 |
| 89 |
set global innodb_stats_method = "nulls_unequal"; |
| 90 |
analyze table table_bug30423; |
| 91 |
Table Op Msg_type Msg_text |
| 92 |
test.table_bug30423 analyze status OK |
| 93 |
set global innodb_stats_method = "nulls_ignored"; |
| 94 |
analyze table table_bug30423; |
| 95 |
Table Op Msg_type Msg_text |
| 96 |
test.table_bug30423 analyze status OK |
| 97 |
set global innodb_stats_method = nulls_equal; |
| 98 |
drop table bug30243_2; |
| 99 |
drop table bug30243_1; |
| 100 |
drop table bug30243_3; |
| 101 |
drop table table_bug30423; |