dolthub / dolthub/dolt

`information_schema.statistics` table is missing `cardinality` column values

Open
#5,200 34 comments 0 reactions 2 assignees Claimed by @zachmu View on GitHub
enhancement sql
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

Set up:
```
> create table t (id int primary key auto_increment, num int, index num_idx(num));
> insert into t (num) values (1),(1),(2),(4),(1);
> analyze table t;
```
MySQL:
```
mysql> select table_name, index_name, column_name, cardinality from information_schema.statistics where table_name = 't';
+------------+------------+-------------+-------------+
| TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
+------------+------------+-------------+-------------+
| t | num_idx | num | 3 |
| t | PRIMARY | id | 5 |
+------------+------------+-------------+-------------+
```
Dolt:
```
select table_name, index_name, column_name, cardinality from information_schema.statistics where table_name = 't';
+------------+------------+-------------+-------------+
| TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
+------------+------------+-------------+-------------+
| t | PRIMARY | id | 0 |
| t | num_idx | num | 0 |
+------------+------------+-------------+-------------+
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.