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

stats.records=0 for a table of Archive engine when it has rows, when we run ANALYZE command

    XMLWordPrintable

Details

    Description

      A mtr test

      --source include/have_archive.inc
      CREATE TABLE gis_point  (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive;
      INSERT INTO gis_point VALUES 
      (101, PointFromText('POINT(10 10)')),
      (102, PointFromText('POINT(20 10)')),
      (103, PointFromText('POINT(20 20)')),
      (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
      set @@optimizer_use_condition_selectivity=4;
      set @@use_stat_tables=PREFERABLY;
      ANALYZE TABLE gis_point;
      explain select * from gis_point;
      

      +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+
      | id | select_type | table    | type   | possible_keys  | key  | key_len | ref   | rows  | Extra    |
      +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+
      |  1 | SIMPLE      | gis_point| ALL    | NULL           | NULL | NULL    | NULL  | 0     |          |
      +----+-------------+----------+--------+---------------------------------+-------+-------+----------+
      

      select * from mysql.table_stats;
      db_name	table_name	cardinality
      test	gis_point	0
      

      After debugging I see, when we enter the function collect_statistics_for_table , for archive engine we get HA_ERR_END_OF_FILE when we start reading the rows, as stats.records = 0

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              varun Varun Gupta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.