From: | Dani Oderbolz <oderbolz(at)ecologic(dot)de> |
---|---|
To: | Mendola Gaetano <mendola(at)bigfoot(dot)com> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Partition DB Tables by month |
Date: | 2003-07-30 16:17:06 |
Message-ID: | 3F27EF82.6060906@ecologic.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Mendola Gaetano wrote:
> CREATE TABLE foo (field_a
>
>field_b
>......
>fast_search BOOLEAN NOT NULL DEFAULT 1,
>time_stamp TIMESTAMPTZ NOT NULL DEFAULT now()
>);
>CREATE INDEX idx_fast_search ON foo ( fast_search ) where fast_search = 't';
>
>for each field to index:
>CREATE INDEX idx_field_a ON foo ( field_a ) where fast_search = 't';
>CREATE INDEX idx_field_b ON foo ( field_b ) where fast_search = 't';
>
>
>at the beginning of each month you can now do:
>
>UPDATE foo SET fast_search = 'f'
>WHERE time_stamp < now() AND
>fast_search = 't';
>
>
I guess we are missunderstanding each other.
I meant you were saying that you could have a partial index on a view
which does a Union All of may tables (each table contains a Month).
But I think thats really not possible.
Cheers,
Dani
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-07-30 16:26:40 | Re: Postgres db corrupted ? |
Previous Message | Mendola Gaetano | 2003-07-30 16:01:33 | Re: Postgres db corrupted ? |