[MDEV-14516] TokuDB duplicates PK columns in secondary index Created: 2017-11-27 Updated: 2018-01-29 Resolved: 2018-01-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - TokuDB |
| Affects Version/s: | 10.1.29 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Julien Muchembled | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | upstream | ||
| Description |
|
Given the following table:
tokuftdump shows that the 'tid' index duplicates all columns of the primary key whereas they're already in the secondary key. IOW, TokuDB stores:
instead of only (like InnoDB):
This is quite space inefficient with all the obvious consequences (less efficient caches, more time to compress). |
| Comments |
| Comment by Sergei Golubchik [ 2017-11-28 ] |
|
Yes, that's how TokuDB (and InnoDB too) works. The primary key is the row identifier, all secondary keys refer to a row by storing the corresponding primary key. There are many articles and blog posts about using short primary keys for InnoDB, you can find some suggestions there. |
| Comment by Sergei Golubchik [ 2017-11-28 ] |
|
Also, in your example, apparently, TokuDB does not remove redundant columns from the index definition. If you'd want to have this fixed, try to report a bug to Percona, who own and maintain TokuDB nowadays. |
| Comment by Julien Muchembled [ 2017-11-28 ] |
|
> Also, in your example, apparently, TokuDB does not remove redundant columns from the index definition. That's the point of this MDEV. Maybe the title is misleading. Not sure it should remain closed. > If you'd want to have this fixed, try to report a bug to Percona, who own and maintain TokuDB nowadays. Ok, I will. As a user of MariaDB, I reported it first in case there's any difference with Percona. And I also saw existing bug reports for TokuDB here. |
| Comment by Sergei Golubchik [ 2017-11-28 ] |
|
okay, I'll reopen it and mark as "upstream". After Percona fixes it, we could be able to merge the fix. |
| Comment by Julien Muchembled [ 2018-01-29 ] |
|
TDB-86 was closed as Won't Fix (for Percona, it's too much work for the improvement). You may want to do the same. |
| Comment by Elena Stepanova [ 2018-01-29 ] |
|
Closed based on the comment above. |