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

ANALYZE shows r_rows=0

    XMLWordPrintable

Details

    Description

      ANALYZE-stmt may print 0 in r_rows column:

      create table t1(a int);
      insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
      create table t2 (a int, key(a));
      insert into t2 values (0),(1);
      analyze select * from t1 straight_join t2 force index(a) where t2.a=t1.a;
      id     select_type     table   type    possible_keys   key     key_len ref     rows    r_rows  filtered        r_filtered      Extra
      1      SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    10      10      100.00  100.00  Using where
      1      SIMPLE  t2      ref     a       a       5       test.t1.a       2       0       100.00  100.00  Using index

      this happens when some index lookups do not yield a row.
      We should change r_rows to show fractions.

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.