top-objects: largest tables and indexes
The largest tables (heap, indexes, TOAST) and indexes of this database.
Captured on 2026-10-07 (UTC+08) on a local KingbaseES V008R006C009B0014 primary and standby, database test, using ~/kbdiag built from Go source commit 96c874f (static linux/amd64 binary). This is lab evidence, not production validation. Nothing was injected. Values belong to this capture only.
Usage
| Option | Effect |
|---|---|
--limit N | Show at most N rows per list; default 20, 0 for all |
--json | Print JSON |
Connection options are the same as for sessions and it looks at the database you are connected to. This command only shows; it has no findings.
Primary
tablesordered by total size.totalis the heap, indexes and TOAST added together:total = heap + indexes + toast. The split answers “is it big because of data, indexes or large columns”, and the remedies differ.heapispg_table_sizeminus TOAST, so it includes the free space and visibility maps. A TOAST table and its index are not listed on their own; they count under the parent table.- Sizes are exact, not
relpagesestimates (the opposite offreeze): this command’s whole point is “who takes space now”, and after a bulk load without ANALYZErelpagesis stale. The cost is that the size functions take anAccessShareLock, so when a table is held by something like VACUUM FULL the whole probe isskippedatlock_timeoutwith the reason written out, instead of showing partial results. A table dropped while the query runs reads NULL and is filtered out, so an ETL that creates and drops temporary tables does not fail the probe. rows (est.)isreltuples.indexeslists the largest indexes with the table they belong to. Size is the whole point, so the usage count is onkbdiag table <name>.- Partitions are not summed up to their parent.
- No judgment: how big is too big has no objective line. So the verdict is OK only when everything was collected; an uncollected probe makes it UNKNOWN.
- The lab shows the bulk of the space in tables created for tests (
orders,flight_psg_new_info,kbdiag_test).
Standby and without privileges
The standby and a kbdiag_ro account (no monitoring role, over 127.0.0.1) return the same rows as the primary in the lab; only the first line differs (role, user, time). Sizes need no privilege, so nothing is hidden. The standby capture is from kes-node2, the kbdiag_ro one from kes-node1.
Exit codes
| Code | Meaning |
|---|---|
| 0 | OK |
| 3 | UNKNOWN: data not collected or not visible |
| 64 | Usage error |
| 69 | Cannot connect |