Re: Problem with default partition pruning

Ibrar Ahmed <ibrar.ahmad@gmail.com>

From: Ibrar Ahmed <ibrar.ahmad@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Cc: Yuzuko Hosoya <yuzukohosoya@gmail.com>
Date: 2019-03-04T17:29:00Z
Lists: pgsql-hackers
Hi 

Patch work fine to me, but I have one test case where default partition still scanned. 

postgres=# explain select * from test1 where (id < 10) and true;
                            QUERY PLAN                             
-------------------------------------------------------------------
 Append  (cost=0.00..55.98 rows=846 width=36)
   ->  Seq Scan on test1_1  (cost=0.00..25.88 rows=423 width=36)
         Filter: (id < 10)
   ->  Seq Scan on test1_def  (cost=0.00..25.88 rows=423 width=36)
         Filter: (id < 10)
(5 rows)

Commits

  1. Don't constraint-exclude partitioned tables as much

  2. Apply constraint exclusion more generally in partitioning

  3. Improve pruning of a default partition

  4. Doc: Fix event trigger firing table

  5. Remove obsolete nbtree insertion comment.