yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.87k stars 1.05k forks source link

[YSQL] auto-analyze: skip analyze calls for secondary indexes #23506

Closed yifanguan closed 3 days ago

yifanguan commented 1 month ago

Jira Link: DB-12428

Description

We should only analyze tables in auto analyze service. Currently, we aggregate mutation counts and call analyze for indexes as well. Any secondary index is analyzed along with its base table when its base table analyze is run.

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

yifanguan commented 3 weeks ago

PG cannot analyze non-tables or special system tables. We should follow the same pattern.

postgres=# analyze pg_class_relname_nsp_index;
WARNING:  skipping "pg_class_relname_nsp_index" --- cannot analyze non-tables or special system tables
ANALYZE
yifanguan commented 3 days ago

issue is resolved by commit ee639f4