-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: expose table on-disk size #20712
Copy link
Copy link
Open
Labels
A-sql-encodingRelating to the SQL/KV encoding.Relating to the SQL/KV encoding.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-observability
Description
As of #20627, the admin UI computes the approximate on-disk size of tables. However, it makes sense to expose this information programmatically via SQL. All that's needed for this is to find a place to expose it, and populate it with from (*adminServer).TableStats. This call isn't extremely cheap (has fan-out and needs to scan a subset of the meta entries), but caching could be added as necessary.
Perhaps there is a connection to be made with #20323. It seems reasonable that approximate on-disk size for a table would be exposed in SELECT .. FROM system.table_statistics. (cc @RaduBerinde).
@dianasaur323 for triage.
related: #86017
Jira issue: CRDB-5915
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-encodingRelating to the SQL/KV encoding.Relating to the SQL/KV encoding.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-observability