Re: partitioning question

From: Alex Samad <alex(at)samad(dot)com(dot)au>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: partitioning question
Date: 2017-07-31 02:13:51
Message-ID: CAJ+Q1PXTEpxAHgASx8AC1NwNp2sbOmvVACQBK1ZjJ8ChmLKPYQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How expensive is dynamic over static. I'm looking at storing yearly now,
so I figure if my if then clause has the latest year at the top it should
be very quick.

On 31 July 2017 at 11:07, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:

> On Mon, Jul 31, 2017 at 10:25:54AM +1000, Alex Samad wrote:
> > I note that you link to P10 and I am currently looking at 9.6. The
> changes
> > do look nice for partitioning for p10.
>
> Yes sorry, pg10 is beta - avoid using it except for testing purposes.
>
> > I will add currently we don't delete anything, we will keep adding to it.
> >
> > Also I am thinking my insert trigger becomes a lot smaller and easier if
> I
> > leave it at yearly.
> Note: the trigger function can either be a static function updated monthly
> (to
> handle the next month), preferably with the most recent months tested
> first (so
> a typical newly-inserted rows only goes through one if/case test).
>
> Alternately, the trigger function can dynamically compute the table into
> which
> to insert using plpgsql "format()" similar to here:
> https://www.postgresql.org/docs/9.1/static/plpgsql-
> statements.html#PLPGSQL-QUOTE-LITERAL-EXAMPLE
>
> Justin
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alex Samad 2017-07-31 02:15:33 vacuum on streaming replication
Previous Message Justin Pryzby 2017-07-31 01:07:55 Re: partitioning question