- Categories:
ESTIMATE_ HYBRID_ TABLE_ STORAGE_ USAGE¶
Returns a near-real-time estimate of the total storage usage, in bytes, of a hybrid table.
- See also:
Syntax¶
Arguments¶
'table_name'The name of the hybrid table for which to estimate storage usage.
The name must be a string. If the table identifier is not fully qualified (in the form
db_name.schema_name.table_name), the function resolves it using the database and schema in use for the current session.Because the value is a string, it must be enclosed in single quotes. If the identifier itself requires a double-quoted identifier (for example, mixed-case letters), enclose the double-quoted identifier inside single quotes (for example,
'mydb.myschema."MyTable"').
Usage notes¶
-
The function operates only on hybrid tables. Calling it on a standard table, view, or other object returns an error.
-
To call the function, the role in use must have the SELECT privilege on the target table. Otherwise, the function returns an error indicating that the table does not exist or that you are not authorized.
-
The reported value is an estimate. It is derived from sampled storage metadata, so it can differ from exact byte counts and can lag recent writes. For a table that was just created, or that contains only a small amount of data, the function can report
0bytes until enough data accumulates for the estimate to register. -
TOTAL_ESTIMATED_BYTESreflects the total storage used by the table, including base (primary key) data, secondary indexes, and older versions of the table’s data still retained in the underlying store. It does not include data stored in cloud object storage. -
The function must be called in the
FROMclause of a query and wrapped inTABLE(...). For more information, see Table functions.
Output¶
The function returns a single row with the following columns:
| Column Name | Data Type | Description |
|---|---|---|
| TABLE_NAME | VARCHAR | Fully qualified name of the hybrid table. |
| TOTAL_ESTIMATED_BYTES | NUMBER | Estimated total storage usage of the table, in bytes. |
Examples¶
Estimate the storage usage of a hybrid table:
Return just the estimated byte count: