Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8662

partitioning forcing a table scan in each partition

    XMLWordPrintable

Details

    Description

      Hi guys, i'm using partitioning in some tables, and this cause table scan in all partitions, lets check:

      CREATE TABLE a (
      id decimal(22,1) not null default 0,
      primary key (id)
      );
       
      CREATE TABLE b(
      id decimal(22,1) not null default 0,
      id2 int not null default 0,
      primary key (id,id2)
      )PARTITION BY RANGE (FLOOR(id))
      (PARTITION s0 VALUES LESS THAN (100000) ,
       PARTITION s1 VALUES LESS THAN (450000) ,
       PARTITION s2 VALUES LESS THAN (800000) ,
       PARTITION s3 VALUES LESS THAN MAXVALUE)
       
      CREATE TABLE c (
      id decimal(22,1) not null default 0,
      primary key (id)
      );
      id int not null default 0,
       

      populate tables with many data (0 - 1000000 rows)

      execute:

      select a.*,b.*
      from a,b,c
      where a.id=b.id and a.id=c.id and b.id=c.id 

      my explain b don't use index
      executing ALTER TABLE b REMOVE PARTITIONING and running query again i have b using primary key

      i can provide better test if you need

      Attachments

        Activity

          People

            Unassigned Unassigned
            rspadim roberto spadim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.