Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-4288

In secondary indexes, TokuDB does not remove redundant columns from the index definition

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: TokuDB
    • Labels:
      None
    • Environment:
      • MariaDB 10.1.29 (reported first at MDEV-14516)
      • tokudb_version = 5.6.37-82.2

      Description

      Given the following table:

      CREATE TABLE IF NOT EXISTS obj (
        `partition` SMALLINT UNSIGNED NOT NULL,
        oid BIGINT UNSIGNED NOT NULL,
        tid BIGINT UNSIGNED NOT NULL,
        data_id BIGINT UNSIGNED NULL,
        value_tid BIGINT UNSIGNED NULL,
        PRIMARY KEY (`partition`, oid, tid),
        KEY tid (`partition`, tid, oid),
        KEY (data_id)
      ) ENGINE=TokuDB;
      

      tokuftdump shows that the 'tid' index duplicates all columns of the primary key whereas they're already in the secondary key. IOW, TokuDB stores:

      <partition><tid><oid><partition><oid><tid> => ''
      

      instead of only (like InnoDB):

      <partition><tid><oid> => ''
      

      This is quite space inefficient with all the obvious consequences (less efficient caches, more time to compress).

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              george.lorch George Lorch
              Reporter:
              jmuchemb Julien Muchembled
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: