Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

Postgres inherit indexes for partitioned tables

$
0
0

I have a table with approximately 60 million rows that I have partitioned by state into 53 sub-tables. These tables “inherit” the big table like so:

CREATE TABLE b2b_ak (LIKE b2b including indexes, CHECK ( state = 'AK') ) INHERITS (b2b8) TABLESPACE B2B;

My question is this: if I do not build the indexes on b2b8 until after the copy statement completes, do the sub-tables inherit the indexes? In other words I want to do this:

Create b2b8
Create b2b8_ak inherits b2b8
COPY b2b8 FROM bigcsvfile.csv
CREATE INDEX CONCURRENTLY

And have the whole thing turn out to have created all of the indexes on the sub-tables.


Viewing all articles
Browse latest Browse all 1138

Trending Articles