26.5. Таблицы метаданных #
- 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_file_partition_value- 26.5.17.
pga_transaction_log- 26.5.18.
pga_proxy_table- 26.5.19. Примеры использования снимков
- 26.5.2.
На диаграмме ниже показана структура таблиц метаданных и связи между ними.
26.5.1. pga_snapshot #
В этой таблице метаданных содержится информация о снимках.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Идентификатор снимка. На него ссылается большинство таблиц метаданных. Значение увеличивается на 1 для каждого созданного снимка |
|
|
| Дата и время создания снимка |
|
|
| Версия каталога метаданных. Значение увеличивается на 1 для каждого изменения метаданных каталога, например при создании новой аналитической таблицы. Это позволяет кешировать метаданные каталога |
|
|
| Идентификатор, назначаемый следующему объекту каталога метаданных. Значение увеличивается на 1 для каждого созданного объекта каталога, например при создании новой аналитической таблицы |
|
|
| Идентификатор, назначаемый следующему Parquet-файлу. Значение увеличивается на 1 для каждого созданного или удалённого Parquet-файла |
|
|
| Указывает, видны ли объекты каталога метаданных, связанные со снимком. Когда хранимая процедура, например Поле |
26.5.2. pga_snapshot_changes #
В этой таблице метаданных содержится информация об изменениях снимков, которую можно использовать для разрешения конфликтов между разными снимками.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ, внешний ключ | Идентификатор снимка из таблицы метаданных |
|
| - | Список изменений снимка, разделённых запятыми, в следующих форматах:
|
26.5.3. pga_schema #
В этой таблице метаданных содержится информация об аналитических схемах.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Идентификатор аналитической схемы, назначаемый путём увеличения поля |
|
|
| Постоянный идентификатор аналитической схемы, сохраняемый для обеспечения совместимости со схемами Postgres Pro |
|
| Внешний ключ, | Снимок из таблицы метаданных |
|
| Внешний ключ | Снимок из таблицы метаданных Если значение |
|
|
| Уникальное имя аналитической схемы (например, |
|
|
| Идентификатор прокси-таблицы, связанной с аналитической схемой, из таблицы метаданных |
26.5.4. pga_table #
В этой таблице метаданных содержится информация об аналитических таблицах.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Идентификатор аналитической таблицы, назначаемый путём увеличения поля |
|
|
| Постоянный идентификатор аналитической таблицы, сохраняемый для обеспечения совместимости с таблицами-кучами |
|
| Внешний ключ, | Снимок из таблицы метаданных |
|
| Внешний ключ | Снимок из таблицы метаданных Если значение |
|
|
| Идентификатор аналитической схемы, которая содержит аналитическую таблицу, из таблицы метаданных |
|
|
| Имя аналитической таблицы (например, Поля Это позволяет создать новую аналитическую таблицу с тем же именем, что и у ранее удалённой таблицы |
|
|
| Путь к каталогу хранилища с Parquet-файлами аналитической таблицы относительно поля Абсолютный путь генерируется путём соединения поля |
|
| Внешний ключ, | Идентификатор хранилища, который содержит аналитическую таблицу, из таблицы метаданных |
|
| - | Команда |
|
|
| Указывает, были ли обновлены метаданные аналитической таблицы с помощью следующих хранимых процедур: Эта информация используется хранимой процедурой |
|
|
| Идентификатор прокси-таблицы, связанной с аналитической таблицей, из таблицы метаданных |
26.5.5. pga_storage #
В этой таблице метаданных содержится информация о хранилищах.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Идентификатор хранилища, назначаемый путём увеличения поля |
|
| Внешний ключ, | Снимок из таблицы метаданных |
|
| Внешний ключ | Снимок из таблицы метаданных Если значение |
|
|
| Имя хранилища (например, Поля Это позволяет создать новое хранилище с тем же именем, что и у ранее удалённого хранилища |
|
|
| URI корневого каталога хранилища У локальных хранилищ URI простой (например, S3-хранилища отличаются URI с более сложной структурой и логикой разбора (например, |
|
|
| URI каталога хранилища для временных файлов У локальных хранилищ URI простой (например, S3-хранилища отличаются URI с более сложной структурой и логикой разбора (например, |
|
|
| Тип хранилища. В настоящее время поддерживаются локальные, NFS и S3-хранилища |
|
|
| Минимально необходимое свободное место в хранилище, в байтах. Проверяется при выполнении хранимой процедуры Значение по умолчанию: |
|
| Foreign key, | Идентификатор URI, связанного с корневым каталогом хранилища, из таблицы метаданных |
|
| Foreign key, | Идентификатор URI, связанного с каталогом хранилища для временных файлов, из таблицы метаданных |
|
|
| Идентификатор прокси-таблицы, связанной с хранилищем, из таблицы метаданных |
26.5.6. pga_uri #
В этой таблице метаданных содержится системная информация о pgpro_metastore, и она не предназначена для изменения пользователями.
Столбец uri содержит исходные сериализованные URI, связанные с полями uri или tmp_uri таблицы метаданных pga_storage.
Столбец path содержит пути к корневым каталогам хранилищ. Для локальных хранилищ значимы только поля этого столбца, которые, как правило, совпадают с полями uri, за исключением префиксов, указывающих на тип хранилища:
file://для локальных хранилищ;s3://для S3-хранилищ.
Остальные столбцы содержат произвольные URI для S3-хранилищ.
За подробной информацией обратитесь к RFC 3986 и к официальной документации AWS.
26.5.7. pga_folder #
В этой таблице метаданных содержится информация об общих каталогах, используемых для хранения Parquet-файлов. Эти каталоги можно использовать как источник Parquet-файлов для хранимой процедуры metastore.add_files.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Идентификатор общего каталога, назначаемый путём увеличения поля |
|
| Внешний ключ, | Снимок из таблицы метаданных |
|
| Внешний ключ | Снимок из таблицы метаданных Если значение |
|
|
| Путь к общему каталогу относительно корневого каталога хранилища. Полный путь получается путём соединения поля |
|
|
| Имя общего каталога (например, Поля Это позволяет создать новый общий каталог с тем же именем, что и у ранее удалённого каталога |
|
| Внешний ключ, | Идентификатор хранилища, которое содержит общий каталог, из таблицы метаданных |
|
|
| Идентификатор прокси-таблицы, связанной с общим каталогом, из таблицы метаданных |
26.5.8. pga_column #
В этой таблице метаданных содержится информация о столбцах аналитических таблиц.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Идентификатор столбца. Если исходный Parquet-файл содержит поле Поля |
|
| Внешний ключ, | Снимок из таблицы метаданных |
|
| Внешний ключ | Снимок из таблицы метаданных Если значение |
|
| Внешний ключ, | Идентификатор аналитической таблицы, которая содержит столбец, из таблицы метаданных |
|
|
| Порядковый номер столбца. Поля |
|
|
| Имя столбца (например, Поля Это позволяет создать новый столбец с тем же именем, что и у ранее удалённого столбца |
|
|
| Тип столбца, соответствующий одному из типов данных, поддерживаемых pgpro_metastore |
|
| - | Исходное значение столбца, которое присваивается при создании столбца, например после выполнения команды Может принимать значение |
|
| - | Значение по умолчанию, используемое в операциях Может принимать значение |
|
| - | Определяет, может ли столбец содержать значения |
|
| - | Определяет, может ли столбец содержать повторяющиеся значения для разных строк таблицы |
26.5.9. pga_data_file #
В этой таблице метаданных содержится информация о Parquet-файлах.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Идентификатор Parquet-файла, назначаемый путём увеличения поля |
|
| Внешний ключ, | Снимок из таблицы метаданных |
|
| Внешний ключ | Снимок из таблицы метаданных Если значение |
|
| Внешний ключ, | Идентификатор аналитической таблицы, которая содержит Parquet-файл, из таблицы метаданных |
|
|
| Порядковый номер Parquet-файла в аналитической таблице. Поля |
|
|
| Путь к Parquet-файлу (например, |
|
|
| Определяет, указывается ли путь к Parquet-файлу относительно пути к аналитической таблице или является абсолютным. Значение по умолчанию: |
|
|
| Формат файла. В настоящее время поддерживается только формат Parquet |
|
|
| Количество строк в Parquet-файле |
|
|
| Размер Parquet-файла, в байтах |
|
|
| Значение Обозначает начальную позицию файла в аналитической таблице |
|
|
| Контрольная сумма Parquet-файла, вычисленная по алгоритму Эту контрольную сумму можно использовать для проверки Parquet-файла на наличие повреждений. За подробной информацией обратитесь к Разделу 20.7. |
26.5.10. pga_files_scheduled_for_deletion #
В этой таблице метаданных содержится информация о Parquet-файлах, связанных со снимками, которые помечены устаревшими. Эти файлы теперь можно удалить.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ, внешний ключ | Идентификатор Parquet-файла из таблицы метаданных |
|
|
| Путь к Parquet-файлу (например, |
|
|
| Указывает, является ли путь к Parquet-файлу относительным по отношению к пути к аналитической таблице или абсолютным. Значение по умолчанию: |
|
|
| Дата и время запланированного удаления Parquet-файла |
26.5.11. pga_table_stats #
В этой таблице метаданных содержится статистика аналитических таблиц.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ, внешний ключ | Идентификатор аналитической таблицы, для которой собирается статистика, из таблицы метаданных |
|
|
| Количество строк в аналитической таблице |
|
|
| Значение |
|
|
| Общий размер всех Parquet-файлов аналитической таблицы, в байтах |
26.5.12. pga_table_column_stats #
В этой таблице метаданных содержится статистика по столбцам аналитических таблиц.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ, внешний ключ | Идентификатор столбца, для которого собирается статистика, из таблицы метаданных |
|
|
| Определяет, может ли столбец содержать значения |
|
| - | Определяет, может ли столбец содержать значения Эта информация значима только для типов данных |
|
| - | Минимальное значение в столбце. Для единообразия отображается как строка, которую при использовании необходимо преобразовать в тип данных, используемый в столбце. |
|
| - | Максимальное значение в столбце. Для единообразия отображается как строка, которую при использовании необходимо преобразовать в тип данных, используемый в столбце. |
26.5.13. pga_file_column_statistics #
В этой таблице метаданных содержится статистика столбцов для каждого Parquet-файла аналитической таблицы.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ, внешний ключ | Идентификатор Parquet-файла, который содержит столбец, из таблицы метаданных |
|
| Первичный ключ, внешний ключ | Идентификатор столбца, для которого собирается статистика, из таблицы метаданных |
|
|
| Размер столбца, в байтах |
|
|
| Количество значений для столбца в Parquet-файле. Не равно количеству строк, так как столбец может содержать вложенные типы, такие как структуры и списки |
|
|
| Количество значений |
|
| - | Минимальное значение для столбца в пределах Parquet-файла. Может использоваться как верхняя граница для определения минимального значения столбца |
|
| - | Максимальное значение для столбца в пределах Parquet-файла. Может использоваться как нижняя граница для определения максимального значения столбца |
26.5.14. pga_partition_info #
В этой таблице метаданных содержится информация о секционированных аналитических таблицах.
За подробной информацией о секционировании обратитесь к Главе 27.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Идентификатор секции, назначаемый путём увеличения поля |
|
| Внешний ключ, | Снимок из таблицы метаданных |
|
| Внешний ключ | Снимок из таблицы метаданных Если значение |
|
| Внешний ключ, | Идентификатор секционированной аналитической таблицы из таблицы метаданных |
26.5.15. pga_partition_column #
В этой таблице метаданных содержится информация о столбцах секций.
За подробной информацией о секционировании обратитесь к Главе 27.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Внешний ключ | Идентификатор секции, которая содержит столбец, из таблицы метаданных |
|
| Внешний ключ, | Идентификатор столбца из таблицы метаданных |
|
| Внешний ключ, | Идентификатор аналитической таблицы, которая содержит столбец, из таблицы метаданных |
|
|
| Порядковый номер столбца в секции, начиная с 0. Например, если секция содержит столбцы A, B и C, значение |
Секция может содержать несколько столбцов. Сочетание значения partition_id и значения column_id идентифицирует столбец в секции.
26.5.16. pga_file_partition_value #
Эта таблица метаданных соотносит Parquet-файлы с секциями аналитических таблиц.
За подробной информацией о секционировании обратитесь к Главе 27.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Внешний ключ | Идентификатор Parquet-файла из таблицы метаданных |
|
| Внешний ключ, | Идентификатор аналитической таблицы, которая содержит Parquet-файл, из таблицы метаданных |
|
|
| Значение |
|
|
| Значение столбца секции, определяемое значением У всех строк в Parquet-файле должно быть одинаковое значение для этого столбца |
Parquet-файлы могут быть связаны с несколькими секциями. Сочетание значения data_file_id и значения partition_key_index идентифицирует секцию, которой принадлежит файл.
26.5.17. pga_transaction_log #
В этой таблице метаданных содержится информация по протоколированию задач pgpro_metastore, аналогичных стандартным транзакциям СУБД.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Последовательный номер записи транзакции в журнале (LSN) |
|
|
| Идентификатор задачи |
|
| - | Идентификатор хранимой процедуры. Одна задача может состоять из нескольких хранимых процедур |
|
|
| Тип хранимой процедуры. Возможные значения: |
|
| - | Данные, относящиеся к задаче: исходные и полученные в ходе её выполнения |
26.5.18. pga_proxy_table #
В этой таблицы метаданных содержится информация о прокси-таблицах. За подробной информацией о прокси-таблицах обратитесь к Главе 12.
Имя столбца | Тип данных | Ограничение | Описание |
|---|---|---|---|
|
| Первичный ключ | Идентификатор прокси-таблицы |
|
|
| Имя прокси-таблицы, определяющее связанный объект pgpro_metastore. Имя имеет следующий формат:
Где:
Примеры имён прокси-таблиц:
|
26.5.19. Примеры использования снимков #
Выполнение хранимой процедуры metastore.add_storage создаёт новое хранилище в таблице метаданных pga_storage. Для этого изменения создаётся новый снимок в таблице метаданных pga_snapshot. Созданные записи связываются с помощью поля begin_snapshot таблицы метаданных pga_snapshot.
Текущие поля schema_version и next_catalog_id таблицы метаданных pga_snapshot увеличиваются на один, так как были обновлены метаданные и созданы новые записи в таблицах метаданных.
Выполнение хранимой процедуры metastore.remove_storage деактивирует хранилище из таблицы метаданных pga_storage, но не удаляет его физически. Для этого изменения создаётся новый снимок в таблице метаданных pga_snapshot. Созданные записи связываются с помощью поля end_snapshot таблицы метаданных pga_snapshot.
Текущее поле schema_version таблицы метаданных pga_snapshot увеличивается на один, а поле next_catalog_id остаётся неизменным, так как были обновлены метаданные, но не были созданы новые записи в таблицах метаданных.
Выполнение хранимой процедуры metastore.add_table создаёт новую аналитическую таблицу в таблице метаданных pga_table и N новых столбцов в таблице метаданных pga_column. Для этих изменений создаётся N+1 новых снимков в таблице метаданных pga_snapshot. Созданные записи связываются с помощью поля begin_snapshot таблицы метаданных pga_snapshot.
Текущее поле schema_version таблицы метаданных pga_snapshot увеличивается на единицу, а поле next_catalog_id увеличивается на N+1, так как были обновлены метаданные и созданы новые записи в таблицах метаданных. Поле schema_version увеличивается только на единицу, потому что все изменения были выполнены в рамках одной хранимой процедуры.
Поле next_catalog_id+1 используется в качестве поля table_id для новой аналитической таблицы в таблице метаданных pga_table, в то время как поля next_catalog_id+1+N используются в качестве полей column_id для новых столбцов в таблице метаданных pga_column.
Выполнение хранимой процедуры metastore.add_files создаёт один или несколько Parquet-файлов в таблице метаданных pga_data_file. Для этого изменения создаётся N новых снимков в таблице метаданных pga_snapshot. Созданные записи связываются с помощью поля begin_snapshot таблицы метаданных pga_snapshot.
Текущие поля schema_version и next_catalog_id таблицы метаданных pga_snapshot остаются неизменными, так как не были обновлены метаданные и не были созданы новые записи в таблицах метаданных.
Поле next_file_id таблицы метаданных pga_snapshot увеличивается на один, а поля next_file_id+N используются в качестве полей data_file_id для новых Parquet-файлов в таблице метаданных pga_data_file.
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_file_partition_value- 26.5.17.
pga_transaction_log- 26.5.18.
pga_proxy_table- 26.5.19. Examples of Snapshot Usage
- 26.5.2.
The diagram below shows the structure of metadata tables and their relationships.
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 RFC 3986 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 checksum of the Parquet file, computed with the You can use this checksum to check the Parquet file for corruption. For more information, refer to Section 20.7 |
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 |
|---|---|---|---|
|
| 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 |
A partition can contain multiple columns. The combination of the partition_id value and the column_id value identifies the column in the partition.
26.5.16. pga_file_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 |
|---|---|---|---|
|
| 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 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.
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 12.
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 #
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.
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.
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.
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.