citusdata / citusdata/citus_docs

Document how to customize \d+ to report distributed table sizes

Open
#452 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
58
Forks
60
PR merge metrics
No merged PRs in 30d

Description

## Why are we implementing it? (sales eng)

### What are the typical use cases?

People using psql want to use a shortcut to find table size. In psql this shortcut is `\d+`, which calls `pg_catalog.pg_table_size`. Currently that size will under-report for distributed tables. We have a custom Citus function people can call for the true size, but it would be easier to fix the default shortcut.

## Communication goals (e.g. detailed howto vs orientation)

Give people the sql snippet they can use to fix `\d+`.

### Good locations for content in docs structure

https://docs.citusdata.com/en/stable/admin_guide/table_management.html#determining-table-and-relation-size

## How does this work? (devs)

### Example sql

https://gist.github.com/marcocitus/cc3cdd528e4d2e8e35b5e75eeca986c6

### Corner cases, gotchas

https://gist.github.com/marcocitus/cc3cdd528e4d2e8e35b5e75eeca986c6

At time of linking, that gist does not handle errors. It should catch errors to be sure that orig_table_size gets called in the worst case. Alternately, perhaps Citus could run the snippet during install so nobody would have to think about it?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.