Skip to content

sql: expose table on-disk size #20712

Open
@tbg

Description

@tbg

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

Epic: CRDB-24527

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-encodingRelating to the SQL/KV encoding.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-observability

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions