Re: Partitioning and constraint exclusion - Mailing list pgsql-general

From Vick Khera
Subject Re: Partitioning and constraint exclusion
Date
Msg-id CALd+dccfs4RrZmXxTxe3ubBpdR=_C+RPGWxo5ghP+jvypCEa0w@mail.gmail.com
Whole thread Raw
In response to Re: Partitioning and constraint exclusion  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general

On Mon, Sep 7, 2015 at 4:48 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
IIRC ​The planner doesn't understand​
 
​overlaps so having a definition of:

IN (1,2,3,4,5); or nearly equivalently = ANY(ARRAY[1,2,3,4,5]))​

and a request for:

IN (1,3,5) / = ANY(ARRAY[1,3,5]) is going to get you nowhere with the planner.

The partition code does not execute your CHECK condition; it only tests to see if the query includes it explicitly. For example, if you have a split on "id % 100 = 59" for a table, then looking for id = 13059 does you no good; you have to search for "id = 13059 AND id % 100 = 59" to invoke the table exclusions.

pgsql-general by date:

Previous
From: Tom Smith
Date:
Subject: jsonb value retrieval performance
Next
From: Jayadevan M
Date:
Subject: Re: Partitioning and constraint exclusion