Re: Partitioning and performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ravi Krishna <sravikrishna3(at)gmail(dot)com>
Cc: Jan Lentfer <Jan(dot)Lentfer(at)web(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: Partitioning and performance
Date: 2015-05-28 16:50:58
Message-ID: 19015.1432831858@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ravi Krishna <sravikrishna3(at)gmail(dot)com> writes:
> Perhaps I was not clear. The planner is excluding partitions which can
> not contain the rows looked up in the WHERE clause. However it is
> still scanning the parent table.

Sure, because you don't have a constraint forbidding the parent from
having a matching row, no?

In older versions of PG there wasn't any way around this, but recent
versions allow you to mark a constraint as NO INHERIT, which would
let you attach such a constraint to the parent only.

By and large, though, this doesn't really matter, since an empty
parent table won't cost anything much to scan. If it's significant
relative to the child table access time then you probably didn't
need partitioning in the first place.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ravi Krishna 2015-05-28 16:51:02 Re: Partitioning and performance
Previous Message Jan Lentfer 2015-05-28 16:49:40 Re: Partitioning and performance