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

I_S.TABLES.TABLE_ROWS value for InnoDB table falls to 7 after restart

    XMLWordPrintable

Details

    Description

      Note: We had MDEV-40347 closed as won't fix with the implication that statistics for InnoDB tables can show pretty much anything without manifesting a bug; so maybe this one is another representation of it, I'm just not sure.

      --source include/have_innodb.inc
      --source include/have_sequence.inc
       
      create table t (
        pk int primary key,
        v vector(1) not null,
        vector(v)
      ) engine=InnoDB;
      insert into t select seq, vec_fromtext(concat('[',seq,']'))
        from seq_1_to_1000;
      select total_nodes, cached_nodes from information_schema.vector_indexes
        where table_name = 't';
      alter table t force, algorithm=copy;
      select total_nodes, cached_nodes from information_schema.vector_indexes
        where table_name = 't';
       
      --source include/restart_mysqld.inc
      select total_nodes, cached_nodes from information_schema.vector_indexes
        where table_name = 't';
      select pk from t order by vec_distance(v,0x30303030) limit 2;
      select total_nodes, cached_nodes from information_schema.vector_indexes
        where table_name = 't';
      alter table t force, algorithm=copy;
      select total_nodes, cached_nodes from information_schema.vector_indexes
        where table_name = 't';
       
      drop table t;
      

      PR-4955 ec8dc039fc534e349f1b0fe3282fcee02230c9fd

      alter table t force, algorithm=copy;
      select total_nodes, cached_nodes from information_schema.vector_indexes
      where table_name = 't';
      total_nodes	cached_nodes
      1000	0
      # restart
      select total_nodes, cached_nodes from information_schema.vector_indexes
      where table_name = 't';
      total_nodes	cached_nodes
      1	0
      select pk from t order by vec_distance(v,0x30303030) limit 2;
      pk
      1
      2
      select total_nodes, cached_nodes from information_schema.vector_indexes
      where table_name = 't';
      total_nodes	cached_nodes
      1	319
      alter table t force, algorithm=copy;
      select total_nodes, cached_nodes from information_schema.vector_indexes
      where table_name = 't';
      total_nodes	cached_nodes
      1000	0
      

      In the test case above, TOTAL_NODES count after ALTER is still correct (or is close), but after server restart it becomes 1, and using the vector index doesn't fix it. DDL or DML on the table does (not included in the test case).

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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