refactor(sql): заменен тип сжатия zlib на zstd для AO-таблиц
- Зачем: - zstd (level 1) является современным стандартом для Greenplum 6.0+, обеспечивая более высокую скорость декомпрессии и лучшее сжатие. - Что: - обновлены все DDL стейджинга (STG) и базовых таблиц. - обновлена архитектурная документация (ADR-3) и планы реализации. - исправлены примеры кода в Airflow DAG и описании ETL. - Проверка: - успешное выполнение CREATE TABLE с новыми параметрами в Greenplum 6.27.1.
This commit is contained in:
@@ -27,7 +27,7 @@ CREATE TABLE IF NOT EXISTS stg.airplanes (
|
||||
load_dttm TIMESTAMP NOT NULL DEFAULT now(),
|
||||
batch_id TEXT
|
||||
)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zlib, compresslevel=1)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zstd, compresslevel=1)
|
||||
-- Ключ распределения: airplane_code
|
||||
-- Обоснование: airplane_code — это уникальный идентификатор самолёта.
|
||||
-- Использование airplane_code обеспечивает:
|
||||
|
||||
@@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS stg.airports (
|
||||
load_dttm TIMESTAMP NOT NULL DEFAULT now(),
|
||||
batch_id TEXT
|
||||
)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zlib, compresslevel=1)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zstd, compresslevel=1)
|
||||
-- Ключ распределения: airport_code
|
||||
-- Обоснование: airport_code — это уникальный идентификатор аэропорта.
|
||||
-- Использование airport_code обеспечивает:
|
||||
|
||||
@@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS stg.boarding_passes (
|
||||
load_dttm TIMESTAMP NOT NULL DEFAULT now(),
|
||||
batch_id TEXT
|
||||
)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zlib, compresslevel=1)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zstd, compresslevel=1)
|
||||
-- Ключ распределения: ticket_no
|
||||
-- Обоснование: ticket_no — это основной бизнес-ключ для билетов.
|
||||
-- Использование ticket_no обеспечивает:
|
||||
|
||||
@@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS stg.bookings (
|
||||
load_dttm TIMESTAMP NOT NULL DEFAULT now(),
|
||||
batch_id TEXT NOT NULL
|
||||
)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zlib, compresslevel=1)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zstd, compresslevel=1)
|
||||
-- Ключ распределения: book_ref
|
||||
-- Обоснование: book_ref — это уникальный идентификатор бронирования.
|
||||
-- Использование book_ref обеспечивает:
|
||||
|
||||
@@ -32,7 +32,7 @@ CREATE TABLE IF NOT EXISTS stg.flights (
|
||||
load_dttm TIMESTAMP NOT NULL DEFAULT now(),
|
||||
batch_id TEXT
|
||||
)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zlib, compresslevel=1)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zstd, compresslevel=1)
|
||||
-- Ключ распределения: flight_id
|
||||
-- Обоснование: flight_id — это уникальный идентификатор рейса.
|
||||
-- Использование flight_id обеспечивает:
|
||||
|
||||
@@ -35,7 +35,7 @@ CREATE TABLE IF NOT EXISTS stg.routes (
|
||||
load_dttm TIMESTAMP NOT NULL DEFAULT now(),
|
||||
batch_id TEXT
|
||||
)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zlib, compresslevel=1)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zstd, compresslevel=1)
|
||||
-- Ключ распределения: route_no
|
||||
-- Обоснование: route_no — бизнес-идентификатор маршрута и часто используется в фильтрах/джойнах.
|
||||
-- Использование route_no обеспечивает:
|
||||
|
||||
@@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS stg.seats (
|
||||
load_dttm TIMESTAMP NOT NULL DEFAULT now(),
|
||||
batch_id TEXT
|
||||
)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zlib, compresslevel=1)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zstd, compresslevel=1)
|
||||
-- Ключ распределения: airplane_code
|
||||
-- Обоснование: airplane_code обеспечивает коллокацию seats ↔ airplanes при JOIN по airplane_code
|
||||
-- (в MPP это уменьшает вероятность перераспределения данных / motion).
|
||||
|
||||
@@ -26,7 +26,7 @@ CREATE TABLE IF NOT EXISTS stg.segments (
|
||||
load_dttm TIMESTAMP NOT NULL DEFAULT now(),
|
||||
batch_id TEXT
|
||||
)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zlib, compresslevel=1)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zstd, compresslevel=1)
|
||||
-- Ключ распределения: ticket_no
|
||||
-- Обоснование: ticket_no — это основной бизнес-ключ для билетов.
|
||||
-- Использование ticket_no обеспечивает:
|
||||
|
||||
@@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS stg.tickets (
|
||||
load_dttm TIMESTAMP NOT NULL DEFAULT now(),
|
||||
batch_id TEXT
|
||||
)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zlib, compresslevel=1)
|
||||
WITH (appendonly=true, orientation=row, compresstype=zstd, compresslevel=1)
|
||||
-- Ключ распределения: book_ref
|
||||
-- Обоснование: book_ref — это основной бизнес-ключ для бронирований.
|
||||
-- Использование book_ref обеспечивает:
|
||||
|
||||
Reference in New Issue
Block a user