[MDEV-20568] Tokudb, very strange, substantial performance drop Created: 2019-09-12 Updated: 2019-09-12 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - TokuDB |
| Affects Version/s: | 10.3.12, 10.4.7 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Slawomir Pryczek | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
FC 30, |
||
| Description |
|
Hi Guys, during some testing I found a very strange performance issue with toku. Basically when doing a select with WHERE date IN (....) - tokudb is about 4 times as fast to run the select for multiple days than for single day. Checked this on innodb as well and the EXPLAIN format=json is same as for toku, but execution times are exactly the same. So this problem seems to be limited to tokudb only. To reproduce it you'll need 2 queries B. SELECT /SQL_NO_CACHE/ sum(impressions) FROM stats_tr_creative_2001 where date IN ('2019-08-01') Always run query A first and A is always faster for us than query B, even with cold keycache on A and hot keycache on B ... A would be ~2 times faster. When keycache status is same we have around x4 difference (eg. 0.6s for A and 2.8s on B) Reporting as minor because workaround is just to include some non-existing date in the past or in the future, but maybe fixing it would improve toku performance a lot in other scenarios. For query A.
For query B.
Table struct:
|
| Comments |
| Comment by Slawomir Pryczek [ 2019-09-12 ] | |||
|
SQL to populate the table:
INSERT INTO `stats_tr_creative_2001` SELECT seq%10, seq%800000, seq, seq, date_add('2019-08-01', INTERVAL seq/100000 DAY), (seq%50)+(seq/100000) [SQL] SELECT sum(impressions) FROM stats_tr_creative_2001 where date IN ('2019-08-01', '2030-08-02'); [SQL] SELECT sum(impressions) FROM stats_tr_creative_2001 where date IN ('2019-08-01'); |