gendesign/data/sql/65_partitions_rosreestr_2024_h1.sql
lekss361 db6711446a fix
2026-04-30 22:16:44 +03:00

14 lines
1,019 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Partitions для 2024 Q1+Q2 (расширение rosreestr_deals назад во времени).
-- Применять однократно перед загрузкой 02_load_all_quarters.sh. Идемпотентно.
--
-- 2023 в виде квартальных CSV rosreestr НЕ ПУБЛИКУЕТСЯ — поэтому партиций для
-- 2023 не создаём. Архив /data-sets/Архив до 2023г. включительно/ содержит
-- только JSON-снимки от ноя-дек 2021 в формате export-json-region-NN-date-TS.zip
-- (per-region полные дампы), несовместимые с rosreestr_deals_staging.
--
-- Range FROM inclusive, TO exclusive — [start_q, start_next_q).
CREATE TABLE IF NOT EXISTS rosreestr_deals_2024q1 PARTITION OF rosreestr_deals
FOR VALUES FROM ('2024-01-01') TO ('2024-04-01');
CREATE TABLE IF NOT EXISTS rosreestr_deals_2024q2 PARTITION OF rosreestr_deals
FOR VALUES FROM ('2024-04-01') TO ('2024-07-01');