You can use the information_schema.tables view to return information about each table in a database. The view is available for each database and contains one row for each table in the database. You can use a SELECT query to return information about each table as shown in the example below.

To view table information, you must have USAGE privileges on both the schema and the database. You also need ownership of the table or the necessary table-level privileges required for the intended action.

SELECT
  *
FROM
  information_schema.tables;

Columns in information_schema.tables

Each row has the following columns with information about each table.

Column NameData TypeDescription
table_catalogTEXTThe name of the database.
table_schemaTEXTThe name of the schema.
table_nameTEXTThe name of the table.
table_typeTEXTThe table’s type, such as BASE TABLE, EXTERNAL VIEW.
table_ownerTEXTThe owner of the table, or NULL if there is no owner.
createdTIMESTAMPTZThe time that the table or view was created.
last_alteredTIMESTAMPTZNot applicable for Firebolt.
last_altered_byTEXTNot applicable for Firebolt.
primary_indexTEXTAn ordered array of the column names that comprise the primary index definition, if applicable.
number_of_rowsBIGINTThe number of rows in the table.
compressed_bytesBIGINTThe compressed size of the table in bytes.
uncompressed_bytesBIGINTThe uncompressed size of the table in bytes.
compression_ratioNUMERICThe compression ratio (<uncompressed_bytes>/<compressed_bytes>).
number_of_tabletsINTEGERThe number of tablets that comprise the table.
fragmentationDECIMALThe table fragmentation percentage (between 0-100).
typeTEXTThe table’s type.
location_nameTEXTNot applicable for Firebolt.
ddlTEXTThe text of the SQL statement that created the table.
self_referencing_column_nameNULLNot applicable for Firebolt.
reference_generationNULLNot applicable for Firebolt.
user_defined_type_catalogNULLNot applicable for Firebolt.
user_defined_type_schemaNULLNot applicable for Firebolt.
user_defined_type_nameNULLNot applicable for Firebolt.
is_insertable_intoTEXTYES if the table is insertable, NO otherwise.
is_typedTEXTAlways NO.
commit_actionNULLNot applicable for Firebolt.