Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Bypass PostgreSQL catalog overhead with direct partition hash calculations.
-- Parent table CREATE TABLE events ( id bigint, user_id bigint, event_type integer, payload text, created_at timestamp ) PARTITION BY HASH (user_id);
-- First level: 16 partitions by user_id CREATE TABLE events_0 PARTITION OF events FOR VALUES WITH (modulus 16, remainder 0) PARTITION BY HASH (event_type);
shouldn't that be by user_id for the first 16 tables?
There are no comments on this comment yet.
-- Parent table CREATE TABLE events ( id bigint, user_id bigint, event_type integer, payload text, created_at timestamp ) PARTITION BY HASH (user_id);
-- First level: 16 partitions by user_id CREATE TABLE events_0 PARTITION OF events FOR VALUES WITH (modulus 16, remainder 0) PARTITION BY HASH (event_type);
shouldn't that be by user_id for the first 16 tables?