bug or lacking doc hint

From: Marc Millas <marc(dot)millas(at)mokadb(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: bug or lacking doc hint
Date: 2023-06-25 15:01:59
Message-ID: CADX_1abJasPxOFSxDm+XVU3dZSUr5wVBz_xFh7tKcdBDqeozsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have had a perf (++) pb with a join plan cf the pb with join plan thread.
I did simplify the thing up to when its a simple join between a 15M lines
table and a 30k lines table.
if I put in the on part something like table1.a=table2.b, Postgres does the
job in around 1 seconde.

if in the on part of the join I write table1.a=table2.b OR
substr(table1.c,x,x) =table2.d

then I have to cancel the request after 20 minutes seeing disk usage
growing and growing.

When I ask this list, David Rowley suggest to rewrite the SQL, replacing
the OR by a union.

Fine, this do work, even if a bit complex as the original SQL was a set of
intricate joins.

So, either this behaviour ( postgres unable to find an appropriate plan for
join with OR clauses)
is a true bug which is waiting to be corrected, either the doc is lacking a
chapter on which one can read that Postgres does NOT support that syntax as
soon as there is some data volumes.

So, now I am writing some kind of recipe book for the users of that DB.

What should I write ?

Marc MILLAS
Senior Architect
+33607850334
www.mokadb.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2023-06-25 16:24:49 Re: bug or lacking doc hint
Previous Message Patrick O'Toole 2023-06-25 06:29:00 Fwd: Helping planner to chose sequential scan when it improves performance