pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Alexander Lakhin <exclusion@gmail.com>
To: Alexander Korotkov <aekorotkov@gmail.com>
To: Andrei Lepikhov <a.lepikhov@postgrespro.ru>
Cc: Gregory Stark (as CFM) <stark.cfm@gmail.com>
Cc: Michał Kłeczek <michal@kleczek.org>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Removing unneeded self joins
Date: Tue, 30 Apr 2024 09:00:00 +0300
Message-ID: <0ed2cf02-e655-6ec7-a4fe-52fd8d572f65@gmail.com> (raw )
In-Reply-To: <CAPpHfduoAHTp6O7Q8PDe_w=30v0n_06pGe5M65iR4DYcfaYnRw@mail.gmail.com >
References: <64486b0b-0404-e39e-322d-0801154901f3@postgrespro.ru >
<CAM-w4HMZXW+hKc8C+WLQ+gdpEkoh9378a2UGKyZRz7mZVerG+Q@mail.gmail.com >
<c97574c4-13e6-9107-26ab-af2bd626fc85@postgrespro.ru >
<bcf2f3c5-fbdc-f85b-af3e-ebec616160f6@postgrespro.ru >
<05469e80-454b-41d7-d04f-421f42bbd4a9@postgrespro.ru >
<CAPpHfdt9G3EU+vXuqexhweEQoMF-acPUUFuB6hV2Kg0gCy7AjA@mail.gmail.com >
<ebe66358-428c-439f-85dd-da72c9b2b0c2@postgrespro.ru >
<CAPpHfdt-0kVV7O==aJEbjY2iGYBu+XBzTHEbPv_6sVNeC7fffQ@mail.gmail.com >
<48c11b23-9c23-440e-9a3c-020e05196449@postgrespro.ru >
<CAPpHfdsQkY0Gu7bQ9Ekdyzo_5Xxz74TYKbwmk1on1WAASpxXcQ@mail.gmail.com >
<8800ccf2-ae82-461c-92a1-d4c0a22f8cf2@postgrespro.ru >
<CAPpHfdvJ3jBQaJQKrf69K++kXi+Tvzn6TXO-DKXj0KVJjvMebg@mail.gmail.com >
<1bd80083-a13e-4e9f-a7ce-73c3faab521c@postgrespro.ru >
<CAPpHfdsz8E085YF2VoJe2+h4YAShsh7p--t3kQfQTntiCy63Xg@mail.gmail.com >
<922623af-872e-4cdc-9238-129b18bee42d@postgrespro.ru >
<CAPpHfduoAHTp6O7Q8PDe_w=30v0n_06pGe5M65iR4DYcfaYnRw@mail.gmail.com >
Hello Alexander,
23.10.2023 12:47, Alexander Korotkov wrote:
> I think this patch makes substantial improvement to query planning.
> It has received plenty of reviews. The code is currently in quite
> good shape. I didn't manage to find the cases when this optimization
> causes significant overhead to planning time. Even if such cases will
> be spotted there is a GUC option to disable this feature. So, I'll
> push this if there are no objections.
I've discovered another failure, introduced by d3d55ce57.
Please try the following:
CREATE TABLE t (a int unique, b float);
SELECT * FROM t NATURAL JOIN LATERAL
(SELECT * FROM t t2 TABLESAMPLE SYSTEM (t.b)) t2;
With asserts enabled, it triggers
TRAP: failed Assert("!bms_is_member(rti, lateral_relids)"), File: "initsplan.c", Line: 697, PID: 3074054
ExceptionalCondition at assert.c:52:13
create_lateral_join_info at initsplan.c:700:8
query_planner at planmain.c:257:2
grouping_planner at planner.c:1523:17
subquery_planner at planner.c:1098:2
standard_planner at planner.c:415:9
planner at planner.c:282:12
pg_plan_query at postgres.c:904:9
pg_plan_queries at postgres.c:996:11
exec_simple_query at postgres.c:1193:19
PostgresMain at postgres.c:4684:27
With no asserts, I get:
ERROR: failed to construct the join relation
Please take a look at this.
Best regards,
Alexander
view thread (247+ messages) latest in thread
Message-ID: <0ed2cf02-e655-6ec7-a4fe-52fd8d572f65@gmail.com>
Permalink: ../0ed2cf02-e655-6ec7-a4fe-52fd8d572f65@gmail.com/
Also on: postgresql.org/message-id/0ed2cf02-e655-6ec7-a4fe-52fd8d572f65@gmail.com
copy link · copy postgr.es
reply 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: exclusion@gmail.com, aekorotkov@gmail.com, a.lepikhov@postgrespro.ru, stark.cfm@gmail.com, michal@kleczek.org, pgsql-hackers@lists.postgresql.org
Subject: Re: Removing unneeded self joins
In-Reply-To: <0ed2cf02-e655-6ec7-a4fe-52fd8d572f65@gmail.com>
* 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