sb::get_table_size (public)
sb::get_table_size -table_name table_name [ -namespace namespace ] \ [ -block_size block_size ]
Defined in packages/schema-browser/tcl/schema-browser-procs-postgresql.tcl
Returns the size of the table on disk. This information is only updated by the commands VACUUM, ANALYZE, and CREATE INDEX. Thus, if you have been changing your table, run ANALYZE on the table before running this proc.
- Switches:
- -table_name (required)
- The table name
- -namespace (optional, defaults to
"public"
)- The database namespace that contains the table
- -block_size (optional, defaults to
"8192"
)- Size of BLCKSZ (in bytes) used by the database
- Returns:
- This procedure returns a list with 2 items:
- Size of the table on disk (in bytes), or -1 if the table was not found
- Number of rows in the table, or -1 if the table was not found
- Author:
- Gabriel Burca <gburca-openacs@ebixio.com>
- Created:
- 2004-06-27
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set res [db_0or1row sb_get_table_size { select relpages * :block_size as size_in_bytes, reltuples as table_rows from pg_class where relnamespace = (select oid from pg_namespace where nspname = :namespace) and relname = :table_name }] if {$res} { return [list $size_in_bytes $table_rows] } else { # No such table in the namespace? return [list -1 -1] }XQL Not present: Generic, PostgreSQL, Oracle