Re: Partitioning and performance - Mailing list pgsql-general

From Tom Lane
Subject Re: Partitioning and performance
Date
Msg-id 19015.1432831858@sss.pgh.pa.us
Whole thread Raw
In response to Re: Partitioning and performance  (Ravi Krishna <sravikrishna3@gmail.com>)
Responses Re: Partitioning and performance
Re: Partitioning and performance
List pgsql-general
Ravi Krishna <sravikrishna3@gmail.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


pgsql-general by date:

Previous
From: Jan Lentfer
Date:
Subject: Re: Partitioning and performance
Next
From: Ravi Krishna
Date:
Subject: Re: Partitioning and performance