Utility functions
Utility functions help inspect storage and control the running engine.
| Function | Result |
|---|---|
| format_bytes | A byte count formatted as text. |
| drop_cache | Number of cache entries evicted. |
format_bytes
Section titled “format_bytes”format_bytes(bytes)Accepts an integer byte count and returns a VARCHAR using binary units,
such as KiB and MiB. One KiB is 1024 bytes.
SELECT format_bytes(bytes) AS sizeFROM (VALUES (1536::BIGINT)) AS input(bytes);-- size: 1.5 KiBUse it with system metadata:
SELECT name, format_bytes(bytes) AS sizeFROM system.tablesORDER BY bytes DESC;drop_cache
Section titled “drop_cache”drop_cache()Takes no arguments. Clears Pivot’s caches, including compressed and
decompressed data. Returns a BIGINT count of entries evicted.
SELECT drop_cache() AS entries_dropped;The result depends on the cache contents at the time of the call.
