26.5. Metadata Tables #
- 26.5.1.
pga_snapshot- 26.5.2.
pga_snapshot_changes- 26.5.3.
pga_schema- 26.5.4.
pga_table- 26.5.5.
pga_storage- 26.5.6.
pga_uri- 26.5.7.
pga_folder- 26.5.8.
pga_column- 26.5.9.
pga_data_file- 26.5.10.
pga_files_scheduled_for_deletion- 26.5.11.
pga_table_stats- 26.5.12.
pga_table_column_stats- 26.5.13.
pga_file_column_statistics- 26.5.14.
pga_partition_info- 26.5.15.
pga_partition_column- 26.5.16.
pga_partition_value- 26.5.17.
pga_transaction_log- 26.5.18.
pga_proxy_table- 26.5.19. Examples of Snapshot Usage
- 26.5.2.
26.5.1. pga_snapshot #
This metadata table contains information about snapshots.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The snapshot ID. It is referenced by most metadata tables. The value increases by 1 for each created snapshot |
|
|
| The snapshot creation date and time |
|
|
| 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 |
|
|
| 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 |
|
|
| The ID assigned to the next Parquet file. The value increases by 1 each time a Parquet file is created or deleted |
|
|
| Specifies whether metadata catalog objects associated with the snapshot are visible. When a stored procedure, such as You can use the |
26.5.2. pga_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 |
|---|---|---|---|
|
| Primary key, foreign key | The ID of the snapshot from the |
|
| - | A comma-separated list of snapshot changes in the following formats:
|
26.5.3. pga_schema #
This metadata table contains information about analytical schemas.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The analytical schema ID assigned by increasing the |
|
|
| The persistent analytical schema ID stored for compatibility with Postgres Pro schemas |
|
| Foreign key, | The snapshot associated with creating the analytical schema, from the |
|
| Foreign key | The snapshot associated with deleting the analytical schema, from the If the value is |
|
|
| The unique analytical schema name (e.g., |
|
|
| The ID of the proxy table associated with the analytical schema, from the |
26.5.4. pga_table #
This metadata table contains information about analytical tables.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The analytical table ID assigned by increasing the |
|
|
| The persistent analytical table ID stored for compatibility with heap tables |
|
| Foreign key, | The snapshot associated with creating the analytical table, from the |
|
| Foreign key | The snapshot associated with deleting the analytical table, from the If the value is |
|
|
| The ID of the analytical schema that contains the analytical table, from the |
|
|
| The analytical table name (e.g., The This allows you to create a new analytical table with the same name as a previously deleted table |
|
|
| The path to the storage directory with Parquet files of the analytical table relative to the The absolute path is generated by concatenating the |
|
| Foreign key, | The ID of the storage that contains the analytical table, from the |
|
| - | The |
|
|
| Specifies whether the metadata of the analytical table was updated using the following stored procedures: This information is used by the |
|
|
| The ID of the proxy table associated with the analytical table, from the |
26.5.5. pga_storage #
This metadata table contains information about storages.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The storage ID assigned by increasing the |
|
| Foreign key, | The snapshot associated with creating the storage, from the |
|
| Foreign key | The snapshot associated with deleting the storage, from the If the value is |
|
|
| The storage name (e.g., The This allows you to create a new storage with the same name as a previously deleted storage |
|
|
| The URI of the root storage directory Local storages have simple URIs (e.g., S3 storages have URIs with more complicated structures and parsing (e.g., |
|
|
| The URI of the storage directory for temporary files Local storages have simple URIs (e.g., S3 storages have URIs with more complicated structures and parsing (e.g., |
|
|
| The storage type. Local, NFS, and S3 storages are currently supported |
|
|
| The minimum free space for the storage, in bytes. It is verified when executing the Default value: |
|
| Foreign key, | The ID of the URI associated with the root storage directory, from the |
|
| Foreign key, | The ID of the URI associated with the storage directory for temporary files, from the |
|
|
| The ID of the proxy table associated with the storage, from the |
26.5.6. pga_uri #
This metadata table contains system pgpro_metastore information, and it is not intended to be updated by users.
The uri column contains initial serialized URIs associated with the uri or tmp_uri fields of the pga_storage metadata table.
The path column contains paths to root directories of storages. This is the only relevant column for local storages, and its fields usually match uri fields, except for prefixes specifying the storage type:
file://for local storagess3://for S3 storages
Remaining columns contain arbitrary URIs for S3 storages.
For more information, refer to RFS 3968 and to the official AWS documentation.
26.5.7. pga_folder #
This metadata table contains information about shared directories used for storing Parquet files. You can use these directories as a source of Parquet files for the metastore.add_files stored procedure.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The shared directory ID assigned by increasing the |
|
| Foreign key, | The snapshot associated with creating the shared directory, from the |
|
| Foreign key | The snapshot associated with deleting the shared directory, from the If the value is |
|
|
| The path to the shared directory relative to the root storage directory. The absolute path is generated by concatenating the |
|
|
| The shared directory name (e.g., The This allows you to create a new shared directory with the same name as a previously deleted directory |
|
| Foreign key, | The ID of the storage that contains the shared directory, from the |
|
|
| The ID of the proxy table associated with the shared directory, from the |
26.5.8. pga_column #
This metadata table contains information about columns of analytical tables.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The column ID. If the initial Parquet file contains the The |
|
| Foreign key, | The snapshot associated with creating the column, from the |
|
| Foreign key | The snapshot associated with deleting the column, from the If the value is |
|
| Foreign key, | The ID of the analytical table that contains the column, from the |
|
|
| The sequence number of the column. The |
|
|
| The column name (e.g., The This allows you to create a new column with the same name as a previously deleted column |
|
|
| The column type corresponding to one of the supported pgpro_metastore data types |
|
| - | The initial column value after its creation, for example, after executing the It can be |
|
| - | The default column value used in It can be |
|
| - | Specifies whether the column can contain |
|
| - | Specifies whether the column can contain repeating values for different rows |
26.5.9. pga_data_file #
This metadata table contains information about Parquet files.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The Parquet file ID assigned by increasing the |
|
| Foreign key, | The snapshot associated with creating the Parquet file using the |
|
| Foreign key | The snapshot associated with marking snapshots as expired, from the If the value is |
|
| Foreign key, | The ID of the analytical table that contains the Parquet file, from the |
|
|
| The order of the Parquet file in the analytical table. The |
|
|
| The path to the Parquet file (e.g., |
|
|
| Specifies whether the path to the Parquet file is relative to the path to the analytical table or absolute. Default value: |
|
|
| The file format. Currently, only the Parquet format is supported |
|
|
| The number of rows in the Parquet file |
|
|
| The Parquet file size, in bytes |
|
|
| The It indicates the starting position of the file within the analytical table |
|
|
| The current checksum value of the Parquet file. It is used for data integrity checks |
26.5.10. pga_files_scheduled_for_deletion #
This metadata table contains information about Parquet files associated with snapshots that are marked as expired. These files can now be deleted.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key, foreign key | The ID of the Parquet file from the |
|
|
| The path to the Parquet file (e.g., |
|
|
| Specifies whether the path to the Parquet file is relative to the path to the analytical table or absolute. Default value: |
|
|
| The date and time when the Parquet file is scheduled for deletion |
26.5.11. pga_table_stats #
This metadata table contains statistics of analytical tables.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key, foreign key | The ID of the analytical table for which statistics are collected, from the |
|
|
| The number of rows in the analytical table |
|
|
| The |
|
|
| The total size of all Parquet files of the analytical table, in bytes |
26.5.12. pga_table_column_stats #
This metadata table contains statistics of analytical table columns.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key, foreign key | The ID of the column for which statistics are collected, from the |
|
|
| Specifies whether the column can contain |
|
| - | Specifies whether the column can contain This is relevant only for |
|
| - | The minimum column value. It is displayed as a string for consistency and must be converted to the current column data type when used. |
|
| - | The maximum column value. It is displayed as a string for consistency and must be converted to the current column data type when used. |
26.5.13. pga_file_column_statistics #
This metadata table contains column-level statistics for each Parquet file of an analytical table.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key, foreign key | The ID of the Parquet file that contains the column, from the |
|
| Primary key, foreign key | The ID of the column for which statistics are collected, from the |
|
|
| The column size, in bytes |
|
|
| The number of values for the column in the Parquet file. This is not the same as the number of rows since the column can contain nested types, such as structures and lists |
|
|
| The number of |
|
| - | The minimum column value in the Parquet file. It can serve as an upper bound estimate for the minimum column value |
|
| - | The maximum column value in the Parquet file. It can serve as a lower bound estimate for the maximum column value |
26.5.14. pga_partition_info #
This metadata table contains information about partitioned analytical tables. For more information about partitioning, refer to Chapter 27.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The partition ID assigned by increasing the |
|
| Foreign key, | The snapshot associated with creating the partitioned analytical table, from the |
|
| Foreign key | The snapshot associated with deleting the partitioned analytical table, from the If the value is |
|
| Foreign key, | The ID of the partitioned analytical table from the |
26.5.15. pga_partition_column #
This metadata table contains information about partition columns. For more information about partitioning, refer to Chapter 27.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key, foreign key | The ID of the partition that contains the column, from the |
|
| Foreign key | The ID of the column from the |
|
| Foreign key, | The ID of the analytical table that contains the column, from the |
|
|
| The sequence number of the column in the partition starting at 0. For example, if a partition contains columns A, B, and C, the |
26.5.16. pga_partition_value #
This metadata table maps Parquet files to partitions of analytical tables. For more information about partitioning, refer to Chapter 27.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key, foreign key | The ID of the Parquet file from the |
|
| Foreign key, | The ID of the analytical table that contains the Parquet file, from the |
|
|
| The |
|
|
| The value of the partition column identified by the All rows in the Parquet file have the same value for the column |
26.5.17. pga_transaction_log #
This metadata table contains logging information about pgpro_metastore tasks analogous to standard DBMS transactions.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The transaction log sequence number (LSN) |
|
|
| The task ID |
|
| - | The stored procedure ID. One task can consist of multiple stored procedures |
|
|
| The stored procedure type. Possible values: |
|
| - | The initial and runtime data associated with the task |
26.5.18. pga_proxy_table #
This metadata table contains information about proxy tables. For more information about proxy tables, refer to Chapter 18.
Column Name | Data Type | Constraint | Description |
|---|---|---|---|
|
| Primary key | The proxy table ID |
|
|
| The proxy table name identifying the associated pgpro_metastore object. The name has the following format:
Where:
Examples of proxy table names:
|
26.5.19. Examples of Snapshot Usage #
Example 26.6.
Executing the metastore.add_storage stored procedure creates a new storage in the pga_storage metadata table. For this update, a new snapshot is created in the pga_snapshot metadata table. The created entries are associated using the begin_snapshot field of the pga_snapshot metadata table.
The current schema_version and next_catalog_id fields of the pga_snapshot metadata table are increased by one since the metadata was updated, and new entries were created in metadata tables.
Example 26.7.
Executing the metastore.remove_storage stored procedure deactivates a storage from the pga_storage metadata table but does not delete it physically. For this update, a new snapshot is created in the pga_snapshot metadata table. The created entries are associated using the end_snapshot field of the pga_snapshot metadata table.
The current schema_version field of the pga_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 created in metadata tables.
Example 26.8.
Executing the metastore.add_table stored procedure creates a new analytical table in the pga_table metadata table and N new columns in the pga_column metadata table. For these updates, N+1 new snapshots are created in the pga_snapshot metadata table. The created entries are associated using the begin_snapshot field of the pga_snapshot metadata table.
The current schema_version field of the pga_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 created in metadata tables. The schema_version field is only increased by one because all updates were made in a single stored procedure.
The next_catalog_id+1 field is used as the table_id field for the new analytical table in the pga_table metadata table, whereas the next_catalog_id+1+N fields are used as the column_id fields for new columns in the pga_column metadata table.
Example 26.9.
Executing the metastore.add_files stored procedure creates one or multiple Parquet files in the pga_data_file metadata table. For this update, N new snapshots are created in the pga_snapshot metadata table. The created entries are associated using the begin_snapshot field of the pga_snapshot metadata table.
The current schema_version and next_catalog_id fields of the pga_snapshot metadata table remain the same since the metadata was not updated, and no new entries were created in metadata tables.
The next_file_id field of the pga_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 pga_data_file metadata table.