From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: bug or lacking doc hint
Date: Sun, 25 Jun 2023 11:24:49 -0500
Message-ID: <20ce23c6-3c35-e5ce-b5bd-edb3371786a2@gmail.com> (raw)
In-Reply-To: <CADX_1abJasPxOFSxDm+XVU3dZSUr5wVBz_xFh7tKcdBDqeozsw@mail.gmail.com>
References: <CADX_1abJasPxOFSxDm+XVU3dZSUr5wVBz_xFh7tKcdBDqeozsw@mail.gmail.com>
On 6/25/23 10:01, Marc Millas wrote:
> 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
That left side SUBSTR() can't be good for the query optimizer. (Or I'm old
and still using habits picked up 25 years ago on a different RDBMS.)
Maybe a function index on table1 would help.
--
Born in Arizona, moved to Babylonia.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: bug or lacking doc hint
In-Reply-To: <20ce23c6-3c35-e5ce-b5bd-edb3371786a2@gmail.com>
References: <CADX_1abJasPxOFSxDm+XVU3dZSUr5wVBz_xFh7tKcdBDqeozsw@mail.gmail.com> <20ce23c6-3c35-e5ce-b5bd-edb3371786a2@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