22.7. Metadata Tables #

This section describes metadata tables.

22.7.1. axe_snapshot #

This metadata table contains information about snapshots.

Column Name

Data Type

Constraint

Description

snapshot_id

BIGINT

Primary key

The snapshot ID.

It is referenced by most metadata tables. The value increases by 1 for each created snapshot

snapshot_time

TIMESTAMP

NOT NULL

The snapshot creation date and time

schema_version

BIGINT

NOT NULL

The metadata catalog version.

The value increases by 1 each time the catalog metadata changes, for example, when a new analytical table is created.

This allows caching the catalog metadata

next_catalog_id

BIGINT

NOT NULL

The ID assigned to the next metadata catalog object.

The value increases by 1 each time a catalog object is created, for example, when a new analytical table is created

next_file_id

BIGINT

NOT NULL

The ID assigned to the next Parquet or delete file.

The value increases by 1 each time a Parquet or delete file is created.

For more information about delete files, refer to Section 22.7.10

22.7.2. axe_snapshot_changes #

This metadata table contains information about snapshot changes. You can use it to resolve conflicts between different snapshots.

Column Name

Data Type

Constraint

Description

snapshot_id

BIGINT

Primary key, foreign key

The ID of the snapshot, from the axe_snapshot metadata table

changes_made

VARCHAR

-

A comma-separated list of snapshot changes in the following formats:

author

VARCHAR

-

The user associated with the snapshot changes

commit_message

VARCHAR

-

The message associated with the snapshot changes

commit_extra_info

VARCHAR

-

Additional information associated with the snapshot changes

22.7.3. axe_storage #

This metadata table contains information about storages.

Column Name

Data Type

Constraint

Description

storage_id

BIGINT

Primary key

The storage ID assigned by increasing the next_catalog_id field of the axe_snapshot metadata table

storage_uuid

UUID

NOT NULL, UNIQUE

The persistent storage ID stored for compatibility with heap tables

begin_snapshot

BIGINT

Foreign key, NOT NULL

The ID of the snapshot associated with creating the storage, from the axe_snapshot metadata table

end_snapshot

BIGINT

Foreign key

The ID of the snapshot associated with deleting the storage, from the axe_snapshot metadata table.

If the value is NULL, the storage is not deleted

storage_name

VARCHAR

NOT NULL

The storage name (e.g., axe_storage).

The storage_name fields are not UNIQUE because storage metadata is not deleted. For each deleted storage, the end_snapshot field is set and the storage can no longer be used.

This allows you to create a new storage with the same name as a previously deleted storage

uri

VARCHAR

NOT NULL, UNIQUE

The URI of the root storage directory

Local storages have simple URIs (e.g., file:///home/j.doe/workspace/axe/).

S3 storages have URIs with more complicated structures and parsing (e.g., s3://premdb/team01.csv?versionId=w_B5qT8s5MkiT09.IRHay0lW.PycsHTS). These URIs are generated using third-party libraries

storage_type

BIGINT

NOT NULL

The storage type.

Local, NFS, and S3 storages are currently supported

22.7.4. axe_folder #

This metadata table contains information about shared directories.

Column Name

Data Type

Constraint

Description

folder_id

BIGINT

Primary key

The shared directory ID assigned by increasing the next_catalog_id field of the axe_snapshot metadata table

folder_uuid

UUID

NOT NULL, UNIQUE

The persistent shared directory ID stored for compatibility with heap tables

begin_snapshot

BIGINT

Foreign key, NOT NULL

The ID of the snapshot associated with creating the shared directory, from the axe_snapshot metadata table

end_snapshot

BIGINT

Foreign key

The ID of the snapshot associated with deleting the shared directory, from the axe_snapshot metadata table.

If the value is NULL, the shared directory is not deleted

storage_id

BIGINT

Foreign key, NOT NULL

The ID of the storage that contains the shared directory, from the axe_storage metadata table

folder_name

VARCHAR

NOT NULL

The shared directory name (e.g., axe_directory).

The folder_name fields are not UNIQUE because shared directory metadata is not deleted. For each deleted shared directory, the end_snapshot field is set and the directory can no longer be used.

This allows you to create a new shared directory with the same name as a previously deleted directory

path

VARCHAR

NOT NULL

The path to the shared directory relative to the root storage directory.

The absolute path is generated by concatenating the uri field of the axe_storage metadata table and the path field of the axe_folder metadata table

22.7.5. axe_schema #

This metadata table contains information about schemas that contain analytical tables.

Column Name

Data Type

Constraint

Description

schema_id

BIGINT

Primary key

The schema ID assigned by increasing the next_catalog_id field of the axe_snapshot metadata table

schema_uuid

UUID

NOT NULL, UNIQUE

The persistent schema ID stored for compatibility with heap tables

begin_snapshot

BIGINT

Foreign key, NOT NULL

The ID of the snapshot associated with creating the schema, from the axe_snapshot metadata table

end_snapshot

BIGINT

Foreign key

The ID of the snapshot associated with deleting the schema, from the axe_snapshot metadata table.

If the value is NULL, the schema is not deleted

schema_name

VARCHAR

NOT NULL

The schema name (e.g., axe_schema).

The schema_name fields are not UNIQUE because schema metadata is not deleted. For each deleted schema, the end_snapshot field is set and the schema can no longer be used.

This allows you to create a new schema with the same name as a previously deleted schema

path

VARCHAR

NOT NULL

The path to the schema directory relative to the root storage directory

path_is_relative

BOOLEAN

NOT NULL

Specifies whether the path to the schema directory is relative to the root storage directory or absolute.

Default value: false

storage_id

BIGINT

Foreign key, NOT NULL

The ID of the storage that contains the schema, from the axe_storage metadata table

22.7.6. axe_table #

This metadata table contains information about analytical tables.

Column Name

Data Type

Constraint

Description

table_id

BIGINT

Primary key

The analytical table ID assigned by increasing the next_catalog_id field of the axe_snapshot metadata table

table_uuid

UUID

NOT NULL, UNIQUE

The persistent analytical table ID stored for compatibility with heap tables

begin_snapshot

BIGINT

Foreign key, NOT NULL

The ID of the snapshot associated with creating the analytical table, from the axe_snapshot metadata table

end_snapshot

BIGINT

Foreign key

The ID of the snapshot associated with deleting the analytical table, from the axe_snapshot metadata table.

If the value is NULL, the analytical table is not deleted

schema_id

BIGINT

Foreign key, NOT NULL

The ID of the schema that contains the analytical table, from the axe_schema metadata table

table_name

VARCHAR

NOT NULL

The analytical table name (e.g., axe_table).

The table_name fields are not UNIQUE because analytical table metadata is not deleted. For each deleted analytical table, the end_snapshot field is set and the table can no longer be used.

This allows you to create a new analytical table with the same name as a previously deleted table

path

VARCHAR

NOT NULL, UNIQUE

The path to the storage directory with Parquet files of the analytical table relative to the uri field of the axe_storage metadata table.

The absolute path is generated by concatenating the uri field of the axe_storage metadata table and the path field of the axe_table metadata table

path_is_relative

BOOLEAN

NOT NULL

Specifies whether the path to the storage directory with Parquet files of the analytical table is relative to the root storage directory or absolute.

Default value: false

storage_id

BIGINT

Foreign key, NOT NULL

The ID of the storage that contains the analytical table, from the axe_storage metadata table

22.7.7. axe_tag #

This metadata table contains tags of metadata catalog objects.

Column Name

Data Type

Constraint

Description

object_id

BIGINT

Primary key

The ID of the metadata catalog object the tag is assigned to

begin_snapshot

BIGINT

Foreign key, NOT NULL

The ID of the snapshot associated with creating the tag, from the axe_snapshot metadata table

end_snapshot

BIGINT

Foreign key

The ID of the snapshot associated with deleting the tag, from the axe_snapshot metadata table.

If the value is NULL, the tag is not deleted

key

VARCHAR

NOT NULL

The tag key

value

VARCHAR

NOT NULL

The tag value

22.7.8. axe_data_file #

This metadata table contains information about Parquet files.

Column Name

Data Type

Constraint

Description

data_file_id

BIGINT

Primary key

The Parquet file ID assigned by increasing the next_file_id field of the axe_snapshot metadata table

begin_snapshot

BIGINT

Foreign key, NOT NULL

The ID of the snapshot associated with creating the Parquet file when adding Parquet files to an analytical table or copying data from heap tables to an analytical table, from the axe_snapshot metadata table

end_snapshot

BIGINT

Foreign key

The ID of the snapshot associated with marking snapshots as expired, from the axe_snapshot metadata table.

If the value is NULL, the Parquet file is not deleted

table_id

BIGINT

Foreign key, NOT NULL

The ID of the analytical table that contains the Parquet file, from the axe_table metadata table

file_order

BIGINT

NOT NULL

The order of the Parquet file in the analytical table.

The file_order fields must be unique within the analytical table, but the ordered sequence can have gaps

path

VARCHAR

NOT NULL, UNIQUE

The path to the Parquet file (e.g., axe_file.parquet)

path_is_relative

BOOLEAN

NOT NULL

Specifies whether the path to the Parquet file is relative to the path to the analytical table or absolute.

Default value: false

file_format

VARCHAR

NOT NULL

The file format.

Currently, only the Parquet format is supported

record_count

BIGINT

NOT NULL

The number of rows in the Parquet file

file_size_bytes

BIGINT

NOT NULL

The Parquet file size, in bytes

footer_size

BIGINT

-

The Parquet file footer size, in bytes

row_id_start

BIGINT

NOT NULL

The row_id value for the first row in the Parquet file.

It indicates the starting position of the file within the analytical table

partition_id

BIGINT

-

The ID of the partition that contains the Parquet file, from the axe_partition_info metadata table

encryption_key

VARCHAR

-

The encryption key of the Parquet file, if encryption is enabled.

You can enable encryption using the read_parquet stored procedure with the encryption_config parameter

mapping_id

BIGINT

-

The ID of the mapping used to map Parquet fields to analytical table columns without field IDs

partial_max

BIGINT

-

The maximum snapshot ID in a partial Parquet file.

Partial Parquet files contain rows inserted by multiple snapshots. For Parquet files that are not partial, the value is NULL

checksum_crc32_header

BIGINT

NOT NULL

The checksum of the Parquet file header, computed with the CRC-32-IEEE 802.3 algorithm when the file is added to an analytical table

checksum_crc32

BIGINT

NOT NULL

The checksum of the Parquet file, computed with the CRC-32-IEEE 802.3 algorithm when the file is added to an analytical table.

You can use this checksum to check the Parquet file for corruption. For more information, refer to Section 19.4

22.7.9. axe_file_column_stats #

This metadata table contains column statistics for each Parquet file of an analytical table.

Column Name

Data Type

Constraint

Description

data_file_id

BIGINT

Primary key, foreign key

The ID of the Parquet file that contains the column, from the axe_data_file metadata table

table_id

BIGINT

Primary key, foreign key

The ID of the analytical table that contains the column, from the axe_table metadata table

column_id

BIGINT

Primary key, foreign key

The ID of the column for which statistics are collected, from the axe_column metadata table

column_size_bytes

BIGINT

NOT NULL

The column size, in bytes

value_count

BIGINT

NOT NULL

The number of values in the column.

This is not the same as the number of rows since the column can contain nested types, such as structures and lists

null_count

BIGINT

NOT NULL

The number of NULL values in the column

min_value

VARCHAR

-

The minimum column value

max_value

VARCHAR

-

The maximum column value

contains_nan

BOOLEAN

-

Specifies whether the column can contain NaN values.

This is relevant only for FLOAT, DOUBLE, and NUMERIC data types

22.7.10. axe_delete_file #

This metadata table contains information about delete files — Parquet files that store the positions of rows deleted from analytical tables.

Column Name

Data Type

Constraint

Description

delete_file_id

BIGINT

Primary key

The delete file ID assigned by increasing the next_file_id field of the axe_snapshot metadata table

table_id

BIGINT

Foreign key, NOT NULL

The ID of the analytical table whose rows are deleted, from the axe_table metadata table

begin_snapshot

BIGINT

Foreign key, NOT NULL

The ID of the snapshot associated with deleting rows from the Parquet file, from the axe_snapshot metadata table

end_snapshot

BIGINT

Foreign key

The ID of the snapshot associated with removing the delete file, from the axe_snapshot metadata table.

If the value is NULL, the delete file is not removed

data_file_id

BIGINT

Foreign key, NOT NULL

The ID of the Parquet file whose rows are deleted, from the axe_data_file metadata table

path

VARCHAR

NOT NULL, UNIQUE

The path to the delete file (e.g., axe_file-deletes.parquet)

path_is_relative

BOOLEAN

NOT NULL

Specifies whether the path to the delete file is relative to the path to the analytical table or absolute.

Default value: false

format

VARCHAR

NOT NULL

The delete file format.

Currently, only the Parquet format is supported

delete_count

BIGINT

NOT NULL

The number of rows in the delete file

file_size_bytes

BIGINT

NOT NULL

The delete file size, in bytes

footer_size

BIGINT

-

The delete file footer size, in bytes

encryption_key

VARCHAR

-

The encryption key of the delete file, if encryption is enabled.

You can enable encryption using the read_parquet stored procedure with the encryption_config parameter

partial_max

BIGINT

-

The maximum snapshot ID in a partial delete file.

Partial delete files contain rows deleted by multiple snapshots. For delete files that are not partial, the value is NULL

22.7.11. axe_column #

This metadata table contains information about analytical table columns.

Column Name

Data Type

Constraint

Description

column_id

BIGINT

Primary key

The column ID.

If the initial Parquet file contains the field_id field, its value is used as the column_id field. The ID is not updated until the column is deleted.

The column_id fields must be unique

begin_snapshot

BIGINT

Foreign key, NOT NULL

The ID of the snapshot associated with creating the column, from the axe_snapshot metadata table

end_snapshot

BIGINT

Foreign key

The ID of the snapshot associated with deleting the column, from the axe_snapshot metadata table.

If the value is NULL, the column is not deleted

table_id

BIGINT

Foreign key, NOT NULL

The ID of the analytical table that contains the column, from the axe_table metadata table

column_order

BIGINT

NOT NULL

The sequence number of the column.

The column_order fields must be unique within the analytical table, but the ordered sequence can have gaps

column_name

VARCHAR

NOT NULL

The column name (e.g., axe_column).

The column_name fields are not UNIQUE because column metadata is not deleted. For each deleted column, the end_snapshot field is set and the column can no longer be used.

This allows you to create a new column with the same name as a previously deleted column

column_type

VARCHAR

NOT NULL

The column type corresponding to one of the metadata catalog data types

initial_default

VARCHAR

-

The initial column value after its creation, for example, after executing the ALTER TABLE command.

It can be NULL

default_value

VARCHAR

-

The default column value used in upsert operations.

It can be NULL

nulls_allowed

BOOLEAN

-

Specifies whether the column can contain NULL values

22.7.12. axe_table_stats #

This metadata table contains statistics of analytical tables.

Column Name

Data Type

Constraint

Description

table_id

BIGINT

Primary key, foreign key

The ID of the analytical table for which statistics are collected, from the axe_table metadata table

record_count

BIGINT

NOT NULL

The number of rows in the analytical table

next_row_id

BIGINT

NOT NULL

The row_id value for the next row to be added to the analytical table

file_size_bytes

BIGINT

NOT NULL

The total size of all Parquet files of the analytical table, in bytes

22.7.13. axe_table_column_stats #

This metadata table contains statistics of analytical table columns.

Column Name

Data Type

Constraint

Description

table_id

BIGINT

Primary key, foreign key

The ID of the analytical table that contains the column, from the axe_table metadata table

column_id

BIGINT

Primary key, foreign key

The ID of the column for which statistics are collected, from the axe_column metadata table

contains_null

BOOLEAN

NOT NULL

Specifies whether the column can contain NULL values

contains_nan

BOOLEAN

-

Specifies whether the column can contain NaN values.

This is relevant only for FLOAT, DOUBLE, and NUMERIC data types

min_value

VARCHAR

-

The minimum column value.

It is displayed as a string for consistency and must be converted to the current column data type when used

max_value

VARCHAR

-

The maximum column value.

It is displayed as a string for consistency and must be converted to the current column data type when used

22.7.14. axe_partition_info #

This metadata table contains information about partitioned analytical tables.

Column Name

Data Type

Constraint

Description

partition_id

BIGINT

Primary key

The partition ID assigned by increasing the next_catalog_id field of the axe_snapshot metadata table

begin_snapshot

BIGINT

Foreign key, NOT NULL

The ID of the snapshot associated with creating the partitioned analytical table, from the axe_snapshot metadata table

end_snapshot

BIGINT

Foreign key

The ID of the snapshot associated with deleting the partitioned analytical table, from the axe_snapshot metadata table.

If the value is NULL, the table is not deleted

table_id

BIGINT

Foreign key, NOT NULL

The ID of the partitioned analytical table, from the axe_table metadata table

For more information about Hive partitioning, refer to Chapter 23.

22.7.15. axe_partition_column #

This metadata table contains information about partition columns of analytical tables.

Column Name

Data Type

Constraint

Description

partition_id

BIGINT

Foreign key

The ID of the partition that contains the column, from the axe_partition_info metadata table

column_id

BIGINT

Foreign key, NOT NULL

The ID of the column, from the axe_column metadata table

table_id

BIGINT

Foreign key, NOT NULL

The ID of the analytical table that contains the column, from the axe_table metadata table

partition_key_index

BIGINT

NOT NULL

The sequence number of the column in the partition starting at 0.

For example, if a partition contains columns A, B, and C, the partition_key_index value for the column B is 1

A partition can contain multiple columns. The combination of the partition_id value and the column_id value identifies the column in the partition.

For more information about Hive partitioning, refer to Chapter 23.

22.7.16. axe_file_partition_value #

This metadata table maps Parquet files to partitions of analytical tables.

Column Name

Data Type

Constraint

Description

data_file_id

BIGINT

Foreign key

The ID of the Parquet file, from the axe_data_file metadata table

table_id

BIGINT

Foreign key, NOT NULL

The ID of the analytical table that contains the Parquet file, from the axe_table metadata table

partition_key_index

BIGINT

NOT NULL

The partition_key_index value, from the axe_partition_column metadata table

partition_value

VARCHAR

NOT NULL

The value of the partition column identified by the partition_key_index value.

All rows in the Parquet file have the same value for this column

Parquet files can be associated with multiple partitions. The combination of the data_file_id value and the partition_key_index value identifies the partition to which a file belongs.

For more information about Hive partitioning, refer to Chapter 23.

22.7.17. axe_files_scheduled_for_deletion #

This metadata table contains information about Parquet files associated with snapshots that are marked as expired. You can delete these files using the axe.cleanup_old_files stored procedure.

Column Name

Data Type

Constraint

Description

data_file_id

BIGINT

Primary key, foreign key

The ID of the Parquet file, from the axe_data_file metadata table

storage_id

BIGINT

Foreign key

The ID of the storage that contains the Parquet file, from the axe_storage metadata table

path

VARCHAR

NOT NULL, UNIQUE

The path to the Parquet file (e.g., axe_file.parquet)

path_is_relative

BOOLEAN

NOT NULL

Specifies whether the path to the Parquet file is relative to the path to the analytical table or absolute.

Default value: false

schedule_start

TIMESTAMPTZ

NOT NULL

The date and time when the Parquet file is scheduled for deletion

22.7.18. Examples of Snapshot Usage #

Creating a storage registers an entry in the axe_storage metadata table. For this update, a new snapshot is created and registered in the axe_snapshot metadata table. The registered entries are associated using the begin_snapshot field of the axe_snapshot metadata table.

The current schema_version and next_catalog_id fields of the axe_snapshot metadata table are increased by one since the metadata was updated, and new entries were registered in metadata tables.

Deleting a storage does not delete it physically. Instead, the end_snapshot field of the storage entry in the axe_storage metadata table is set, and the storage can no longer be used. For this update, a new snapshot is created and registered in the axe_snapshot metadata table. The registered entries are associated using the end_snapshot field of the axe_snapshot metadata table.

The current schema_version field of the axe_snapshot metadata table is increased by one, and the next_catalog_id field remains the same, since the metadata was updated, but no new entries were registered in metadata tables.

Creating an analytical table registers an entry in the axe_table metadata table and N entries in the axe_column metadata table. For these updates, N+1 new snapshots are created and registered in the axe_snapshot metadata table. The registered entries of the analytical table and its columns are associated using the begin_snapshot field of the axe_snapshot metadata table.

The current schema_version field of the axe_snapshot metadata table is increased by one, and the next_catalog_id field is increased by N+1 since the metadata was updated, and new entries were registered in metadata tables. The schema_version field is only increased by one because all updates were made in a single SQL command.

The next_catalog_id+1 field is used as the table_id field for the new analytical table in the axe_table metadata table, whereas the next_catalog_id+1+N fields are used as the column_id fields for new columns in the axe_column metadata table.

Adding Parquet files to an analytical table registers entries for one or multiple Parquet files in the axe_data_file metadata table. For this update, N new snapshots are created and registered in the axe_snapshot metadata table. The registered entries of the Parquet files are associated using the begin_snapshot field of the axe_snapshot metadata table.

The current schema_version and next_catalog_id fields of the axe_snapshot metadata table remain the same since the metadata was not updated, and no new entries were registered in metadata tables.

The next_file_id field of the axe_snapshot metadata table is increased by one, and the next_file_id+N fields are used as the data_file_id fields for new Parquet files in the axe_data_file metadata table.

FAQ