REGRESSION: cardinality of partitioned tables became inaccurate after the changes introduced by DB-848

Description

Running the following query against tokudb tables ps76/ps74 then diff shows clearly that the stats became inaccurate after analyze was run:
select table_name, index_name, cardinality from information_schema.statistics where
TABLE_NAME like 'click_facts_%';
2a3,5
> tokudb_analyze_in_background OFF
> tokudb_analyze_mode TOKUDB_ANALYZE_STANDARD
> tokudb_analyze_throttle 0
3a7
> tokudb_auto_analyze 0
11d14
< click_facts_no_partition PRIMARY NULL
13,27c16,31
< click_facts_no_partition by_visit_date NULL
< click_facts_no_partition by_visit_time NULL
< click_facts_no_partition by_visitor NULL
< click_facts_no_partition by_user NULL
< click_facts_no_partition by_content NULL
< click_facts_no_partition by_publication NULL
< click_facts_no_partition by_revenue_source NULL
< click_facts_no_partition by_vendor NULL
< click_facts_no_partition by_eref NULL
< click_facts_no_partition by_original_eref NULL
< click_facts_no_partition by_iref NULL
< click_facts_no_partition by_referring_url NULL
< click_facts_no_partition by_mobile_device NULL
< click_facts_no_partition by_message_id NULL
< click_facts_partition PRIMARY NULL

> click_facts_no_partition PRIMARY 25
> click_facts_no_partition by_visit_date 25
> click_facts_no_partition by_visit_time 25
> click_facts_no_partition by_visitor 25
> click_facts_no_partition by_user 25
> click_facts_no_partition by_content 25
> click_facts_no_partition by_publication 25
> click_facts_no_partition by_revenue_source 25
> click_facts_no_partition by_vendor 25
> click_facts_no_partition by_eref 25
> click_facts_no_partition by_original_eref 25
> click_facts_no_partition by_iref 25
> click_facts_no_partition by_referring_url 25
> click_facts_no_partition by_mobile_device 25
> click_facts_no_partition by_message_id 25
> click_facts_partition PRIMARY 25
29,43c33,46
< click_facts_partition by_visit_date NULL
< click_facts_partition by_visit_time NULL
< click_facts_partition by_visitor NULL
< click_facts_partition by_user NULL
< click_facts_partition by_content NULL
< click_facts_partition by_publication NULL
< click_facts_partition by_revenue_source NULL
< click_facts_partition by_vendor NULL
< click_facts_partition by_eref NULL
< click_facts_partition by_original_eref NULL
< click_facts_partition by_iref NULL
< click_facts_partition by_referring_url NULL
< click_facts_partition by_mobile_device NULL
< click_facts_partition by_message_id NULL
< click_facts_partition_empty_last PRIMARY NULL

> click_facts_partition by_visit_date 25
> click_facts_partition by_visit_time 25
> click_facts_partition by_visitor 25
> click_facts_partition by_user 25
> click_facts_partition by_content 25
> click_facts_partition by_publication 25
> click_facts_partition by_revenue_source 25
> click_facts_partition by_vendor 25
> click_facts_partition by_eref 25
> click_facts_partition by_original_eref 25
> click_facts_partition by_iref 25
> click_facts_partition by_referring_url 25
> click_facts_partition by_mobile_device 25
> click_facts_partition by_message_id 25
45,58c48,62
< click_facts_partition_empty_last by_visit_date NULL
< click_facts_partition_empty_last by_visit_time NULL
< click_facts_partition_empty_last by_visitor NULL
< click_facts_partition_empty_last by_user NULL
< click_facts_partition_empty_last by_content NULL
< click_facts_partition_empty_last by_publication NULL
< click_facts_partition_empty_last by_revenue_source NULL
< click_facts_partition_empty_last by_vendor NULL
< click_facts_partition_empty_last by_eref NULL
< click_facts_partition_empty_last by_original_eref NULL
< click_facts_partition_empty_last by_iref NULL
< click_facts_partition_empty_last by_referring_url NULL
< click_facts_partition_empty_last by_mobile_device NULL
< click_facts_partition_empty_last by_message_id NULL

> click_facts_partition_empty_last PRIMARY 26
> click_facts_partition_empty_last by_visit_date 26
> click_facts_partition_empty_last by_visit_time 26
> click_facts_partition_empty_last by_visitor 26
> click_facts_partition_empty_last by_user 26
> click_facts_partition_empty_last by_content 26
> click_facts_partition_empty_last by_publication 26
> click_facts_partition_empty_last by_revenue_source 26
> click_facts_partition_empty_last by_vendor 26
> click_facts_partition_empty_last by_eref 26
> click_facts_partition_empty_last by_original_eref 26
> click_facts_partition_empty_last by_iref 26
> click_facts_partition_empty_last by_referring_url 26
> click_facts_partition_empty_last by_mobile_device 26
> click_facts_partition_empty_last by_message_id 26
70c74
< click_facts_no_partition by_visit_date 2

> click_facts_no_partition by_visit_date 4
73c77
< click_facts_no_partition by_user 8

> click_facts_no_partition by_user 25
75,76c79,80
< click_facts_no_partition by_publication 1
< click_facts_no_partition by_revenue_source 12

> click_facts_no_partition by_publication 2
> click_facts_no_partition by_revenue_source 25
78,79c82,83
< click_facts_no_partition by_eref 1
< click_facts_no_partition by_original_eref 1

> click_facts_no_partition by_eref 2
> click_facts_no_partition by_original_eref 2
81,83c85,87
< click_facts_no_partition by_referring_url 12
< click_facts_no_partition by_mobile_device 8
< click_facts_no_partition by_message_id 1

> click_facts_no_partition by_referring_url 25
> click_facts_no_partition by_mobile_device 25
> click_facts_no_partition by_message_id 2
86,87c90,91
< click_facts_partition by_visit_date 1
< click_facts_partition by_visit_time 12

> click_facts_partition by_visit_date 3
> click_facts_partition by_visit_time 25
89c93
< click_facts_partition by_user 8

> click_facts_partition by_user 25
91c95
< click_facts_partition by_publication 1

> click_facts_partition by_publication 3
94,95c98,99
< click_facts_partition by_eref 1
< click_facts_partition by_original_eref 1

> click_facts_partition by_eref 3
> click_facts_partition by_original_eref 3
98,99c102,103
< click_facts_partition by_mobile_device 12
< click_facts_partition by_message_id 1

> click_facts_partition by_mobile_device 25
> click_facts_partition by_message_id 3
102,103c106,107
< click_facts_partition_empty_last by_visit_date 1
< click_facts_partition_empty_last by_visit_time 13

> click_facts_partition_empty_last by_visit_date 26
> click_facts_partition_empty_last by_visit_time 26
105c109
< click_facts_partition_empty_last by_user 8

> click_facts_partition_empty_last by_user 26
107c111
< click_facts_partition_empty_last by_publication 1

> click_facts_partition_empty_last by_publication 26
110,111c114,115
< click_facts_partition_empty_last by_eref 1
< click_facts_partition_empty_last by_original_eref 1

> click_facts_partition_empty_last by_eref 26
> click_facts_partition_empty_last by_original_eref 26
114,115c118,119
< click_facts_partition_empty_last by_mobile_device 13
< click_facts_partition_empty_last by_message_id 1

> click_facts_partition_empty_last by_mobile_device 26
> click_facts_partition_empty_last by_message_id 26

Environment

None

Activity

Show:
Joe Laflamme
January 28, 2016, 8:56 PM

What version(s) does this affect?

George Lorch
February 2, 2016, 1:00 AM

OK, I think I have successfully reproduced the customers issue and identified the cause. No info yet on a release availability, will update the issue when that becomes available.

George Lorch
February 3, 2016, 11:08 PM

Fix pending, testing through jenkins now and should be ready for next PS 5.6 release.

George Lorch
February 4, 2016, 6:25 PM
George Lorch
February 8, 2016, 6:36 PM

Assignee

George Lorch

Reporter

Abdelhak Errami

Labels

External issue ID

None

Freshdesk Tickets

None

Affects versions

Priority

Critical
Configure