Re: Should I partition this table?

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: AlexK <alkuzo(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Should I partition this table?
Date: 2014-07-10 18:56:34
Message-ID: 20140710145634.3151590b50ff5d40e2a01b24@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 10 Jul 2014 11:36:27 -0700 (PDT) AlexK <alkuzo(at)gmail(dot)com> wrote:

> What would be the advantages of partitioning on ranges of ParentID? Each
> query will touch at most one partition. I might or might not get PK indexes
> one level of depth less.

You need to partition by ParentID in order for the example queries you
provided to benefit from the partitioning. You should abstain from removing
the previous comments from each email reply ... I'm not going to dig back
through this thread to find specific examples.

> I understand that I will CLUSTER these smaller tables and benefit from that.
> Other than clustering, what are other advantages?

Personally, I find the benefits of CLUSTER to be debatable. I haven't done
a lot of investigation, but my experience has been that keeping things
CLUSTERed is more work than it's worth. Certainly, if you have a table
that _never_ changes, and he access patterns dictate it, there's no reason
not to CLUSTER, but I'm not convinced that you'll benefit (again, there's
a lot of information about your application use that hasn't been provided
that's necessary to make such a determination)

--
Bill Moran <wmoran(at)potentialtech(dot)com>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2014-07-10 19:02:50 Re: checkpoint
Previous Message Yves Dorfsman 2014-07-10 18:56:22 checkpoint