Zum Inhalt springen
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
Referenzen Technologien Blog Know-how Tools
Über uns Zusammenarbeit Karriere
CS EN DE
Lassen Sie uns sprechen

PostgreSQL partitioning

04. 07. 2023 1 Min. Lesezeit intermediate

Rychlejší dotazy, snadnější údržba velkých tabulek.

Range partitioning

CREATE TABLE orders ( id SERIAL, created_at TIMESTAMPTZ NOT NULL, total DECIMAL ) PARTITION BY RANGE (created_at); CREATE TABLE orders_2024_q1 PARTITION OF orders FOR VALUES FROM (‘2024-01-01’) TO (‘2024-04-01’);

List partitioning

CREATE TABLE logs (id SERIAL, level TEXT, message TEXT) PARTITION BY LIST (level); CREATE TABLE logs_error PARTITION OF logs FOR VALUES IN (‘error’,’fatal’);

pg_partman

CREATE EXTENSION pg_partman; SELECT partman.create_parent(‘public.orders’,’created_at’,’native’,’monthly’);

  • 100M+ řádků
  • Time-series data
  • DROP PARTITION místo DELETE

Partitioning pro velké tabulky

Zrychlí dotazy a zjednoduší údržbu.

postgresqlpartitioningperformance
Teilen:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.