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

SHOW INDEX cardinality and COUNT(DISTINCT primary key) differ

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Incomplete
    • 10.2.27
    • N/A
    • None
    • None
    • CentOS

    Description

      User has a table with of type ENGINE=InnoDB DEFAULT CHARSET=utf8 with a primary key defined as char(32) NOT NULL DEFAULT '',.

      When using SELECT COUNT(DISTINCT primarykey, the user gets 92259134. However, SHOW INDEX's cardinality returns 6853710. This occurs regardless of whether innodb_stats_auto_recalc is on or off and persists through ANALYZE TABLE ... PERSISTENT FOR ALL.

      Will this pose problems for the optimizer? Is there a way to address this if it will?

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            rob.schwyzer@mariadb.com Rob Schwyzer
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.