Multilevel partitioning

From: pasman pasmański <pasman(dot)p(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Multilevel partitioning
Date: 2010-05-05 14:11:50
Message-ID: k2i77a9beeb1005050711k937899eaj9b1f660d9340a3ca@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I create partitions as below.
And run query: select * from test where grupa='A';
Is planner skip to analyze partitions: test2d, test2e, test2f ?

best regards

-------------------------------------------------------------------------------------

CREATE TABLE test (

grupa character varying(1),

id integer,

num integer NOT NULL

);

CREATE TABLE test1 (CONSTRAINT "ABC" CHECK (((grupa >= 'A'::text) AND
(grupa <= 'C'::text))))

INHERITS (test);

CREATE TABLE test1a (CONSTRAINT "A" CHECK ((grupa = 'A'::text)))

INHERITS (test1);

CREATE TABLE test1b (CONSTRAINT "B" CHECK ((grupa = 'B'::text)))

INHERITS (test1);

CREATE TABLE test1c (CONSTRAINT "C" CHECK ((grupa = 'C'::text)))

INHERITS (test1);

CREATE TABLE test2 (CONSTRAINT "DEF" CHECK (((grupa >= 'D'::text) AND
(grupa <= 'F'::text))))

INHERITS (test);

CREATE TABLE test2d (CONSTRAINT "D" CHECK ((grupa = 'D'::text)))

INHERITS (test2);

CREATE TABLE test2e (CONSTRAINT "E" CHECK ((grupa = 'E'::text)))

INHERITS (test2);

CREATE TABLE test2f (CONSTRAINT "F" CHECK ((grupa = 'F'::text)))

INHERITS (test2);

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2010-05-05 15:01:53 Re: need help on postgres
Previous Message Andy Colson 2010-05-05 14:01:57 Re: temp sequence