From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Shawn Wang <shawn.wang@highgo.ca>
Cc: pgsql-hackers@lists.postgresql.org, Yuzuko Hosoya <yuzukohosoya@gmail.com>
Subject: Re: Problem with default partition pruning
Date: Fri, 21 Jun 2019 16:03:14 -0400
Message-ID: <20190621200314.GA20344@alvherre.pgsql> (raw)
In-Reply-To: <156074212109.1403.13115055299095638563.pgcf@coridan.postgresql.org>
On 2019-Jun-17, Shawn Wang wrote:
> I tested different types of key values, and multi-level partitioned tables, and found no problems.
> Only the SQL in the file of src/test/regress/results/partition_prune.out has a space that caused the regression test to fail.
It's not clear to me what patch were you reviewing. The latest patch I
see in this thread, in [1], does not apply in any branches. As another
test, I tried to apply the patch on commit 489e431ba56b (before Tom's
partprune changes in mid May); if you use "patch -p1
--ignore-whitespace" it is accepted, but the failure case proposed at
the start of the thread shows the same behavior (namely, that test1_def
is scanned when it is not needed):
55432 12devel 23506=# create table test1(id int, val text) partition by range (id);
create table test1_1 partition of test1 for values from (0) to (100);
create table test1_2 partition of test1 for values from (150) to (200);
create table test1_def partition of test1 default;
explain select * from test1 where id > 0 and id < 30;
CREATE TABLE
Duración: 5,736 ms
CREATE TABLE
Duración: 5,622 ms
CREATE TABLE
Duración: 3,585 ms
CREATE TABLE
Duración: 3,828 ms
QUERY PLAN
─────────────────────────────────────────────────────────────────
Append (cost=0.00..58.16 rows=12 width=36)
-> Seq Scan on test1_1 (cost=0.00..29.05 rows=6 width=36)
Filter: ((id > 0) AND (id < 30))
-> Seq Scan on test1_def (cost=0.00..29.05 rows=6 width=36)
Filter: ((id > 0) AND (id < 30))
(5 filas)
Duración: 2,465 ms
[1] https://postgr.es/m/00cf01d4eea7$afa43370$0eec9a50$@lab.ntt.co.jp
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, shawn.wang@highgo.ca, yuzukohosoya@gmail.com
Subject: Re: Problem with default partition pruning
In-Reply-To: <20190621200314.GA20344@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox