pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Improve pruning of a default partition
4+ messages / 2 participants
[nested] [flat]
* pgsql: Improve pruning of a default partition
@ 2019-08-04 15:22 Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 1 reply; 4+ messages in thread
From: Alvaro Herrera @ 2019-08-04 15:22 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Improve pruning of a default partition
When querying a partitioned table containing a default partition, we
were wrongly deciding to include it in the scan too early in the
process, failing to exclude it in some cases. If we reinterpret the
PruneStepResult.scan_default flag slightly, we can do a better job at
detecting that it can be excluded. The change is that we avoid setting
the flag for that pruning step unless the step absolutely requires the
default partition to be scanned (in contrast with the previous
arrangement, which was to set it unless the step was able to prune it).
So get_matching_partitions() must explicitly check the partition that
each returned bound value corresponds to in order to determine whether
the default one needs to be included, rather than relying on the flag
from the final step result.
Author: Yuzuko Hosoya <hosoya.yuzuko@lab.ntt.co.jp>
Reviewed-by: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Discussion: https://postgr.es/m/00e601d4ca86$932b8bc0$b982a340$@lab.ntt.co.jp
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/86544071484a48c753e719e0c7c9cf816a59a65e
Modified Files
--------------
src/backend/partitioning/partprune.c | 219 ++++++++++++--------------
src/include/partitioning/partbounds.h | 1 -
src/test/regress/expected/partition_prune.out | 20 ++-
src/test/regress/sql/partition_prune.sql | 1 +
4 files changed, 111 insertions(+), 130 deletions(-)
^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Improve pruning of a default partition
@ 2019-08-04 15:22 Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 0 replies; 4+ messages in thread
From: Alvaro Herrera @ 2019-08-04 15:22 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Improve pruning of a default partition
When querying a partitioned table containing a default partition, we
were wrongly deciding to include it in the scan too early in the
process, failing to exclude it in some cases. If we reinterpret the
PruneStepResult.scan_default flag slightly, we can do a better job at
detecting that it can be excluded. The change is that we avoid setting
the flag for that pruning step unless the step absolutely requires the
default partition to be scanned (in contrast with the previous
arrangement, which was to set it unless the step was able to prune it).
So get_matching_partitions() must explicitly check the partition that
each returned bound value corresponds to in order to determine whether
the default one needs to be included, rather than relying on the flag
from the final step result.
Author: Yuzuko Hosoya <hosoya.yuzuko@lab.ntt.co.jp>
Reviewed-by: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Discussion: https://postgr.es/m/00e601d4ca86$932b8bc0$b982a340$@lab.ntt.co.jp
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/e3967a16d3a0b9c1c6ca20edccc2696e313127e9
Modified Files
--------------
src/backend/partitioning/partprune.c | 219 ++++++++++++--------------
src/include/partitioning/partbounds.h | 1 -
src/test/regress/expected/partition_prune.out | 20 ++-
src/test/regress/sql/partition_prune.sql | 1 +
4 files changed, 111 insertions(+), 130 deletions(-)
^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Improve pruning of a default partition
@ 2019-08-04 15:22 Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 0 replies; 4+ messages in thread
From: Alvaro Herrera @ 2019-08-04 15:22 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Improve pruning of a default partition
When querying a partitioned table containing a default partition, we
were wrongly deciding to include it in the scan too early in the
process, failing to exclude it in some cases. If we reinterpret the
PruneStepResult.scan_default flag slightly, we can do a better job at
detecting that it can be excluded. The change is that we avoid setting
the flag for that pruning step unless the step absolutely requires the
default partition to be scanned (in contrast with the previous
arrangement, which was to set it unless the step was able to prune it).
So get_matching_partitions() must explicitly check the partition that
each returned bound value corresponds to in order to determine whether
the default one needs to be included, rather than relying on the flag
from the final step result.
Author: Yuzuko Hosoya <hosoya.yuzuko@lab.ntt.co.jp>
Reviewed-by: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Discussion: https://postgr.es/m/00e601d4ca86$932b8bc0$b982a340$@lab.ntt.co.jp
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/489247b0e615592111226297a0564e11616361a5
Modified Files
--------------
src/backend/partitioning/partprune.c | 219 ++++++++++++--------------
src/include/partitioning/partbounds.h | 1 -
src/test/regress/expected/partition_prune.out | 20 ++-
src/test/regress/sql/partition_prune.sql | 1 +
4 files changed, 111 insertions(+), 130 deletions(-)
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pgsql: Improve pruning of a default partition
@ 2019-08-04 19:00 Alvaro Herrera <alvherre@2ndquadrant.com>
parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 0 replies; 4+ messages in thread
From: Alvaro Herrera @ 2019-08-04 19:00 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org; +Cc: pgsql-hackers@lists.postgresql.org
On 2019-Aug-04, Alvaro Herrera wrote:
> Improve pruning of a default partition
I just noticed that I failed to credit Shawn Wang, Thibaut Madeleine,
Yoshikazu Imai, Kyotaro Horiguchi as reviewers of this patch.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2019-08-04 19:00 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-08-04 15:22 pgsql: Improve pruning of a default partition Alvaro Herrera <alvherre@alvh.no-ip.org>
2019-08-04 15:22 pgsql: Improve pruning of a default partition Alvaro Herrera <alvherre@alvh.no-ip.org>
2019-08-04 19:00 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2019-08-04 15:22 pgsql: Improve pruning of a default partition Alvaro Herrera <alvherre@alvh.no-ip.org>
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