Skip to main content

Posts

Showing posts from April, 2019

View Partitioning Child table settings - Postgres

I have been an agent of change in my pod and the staff I have been waving is postgres :). We have been working out a new project and the OLTP data store is postgres. Out of the many things I encountered this week two things really topped the list.  Most OLTP workload are random IO. Postgres heep vs cluster key that sorts data  Declarative partitioning is the way forward to keeping data sets manageble and assists with maintenance tasks. The code snippet for bellow provides details of the partition child table properties.    SELECT    nmsp_parent.nspname AS parent_schema,    parent.relname      AS parent,    nmsp_child.nspname  AS child_schema,    child.relname       AS child ,    pg_get_expr(child.relpartbound, child.oid, true) as child_expression,    child.reloptions   FROM pg_inherits     JOIN pg_class parent            ON pg_inherits.inhparent = parent.oid     JOIN pg_class child             ON pg_inherits.inhrelid   = child.oid     JOIN pg_namespace nmsp_pa