Re: Postgresql 13 query engine regression - Mailing list pgsql-general

From Jonathan Chen
Subject Re: Postgresql 13 query engine regression
Date
Msg-id CAJuc1zPXwK-M=Yc2Gm_P4KcV8m00L8AYm__-5jsb+VwFFfpxQQ@mail.gmail.com
Whole thread Raw
In response to Re: Postgresql 13 query engine regression  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi,

On Tue, 11 May 2021 at 10:34, Tom Lane <tgl@sss.pgh.pa.us> wrote:
[...]
> As Adrian noted, you haven't provided enough detail to let anyone
> offer more than generalities.

I'll be providing the output of EXPLAIN (ANALYZE, BUFFERS) in a separate post.

> However, in the spirit of generalities ...
[.. helpful explanation snipped ..]

> Rather than blaming the planner for not being lucky, you should be
> thinking about what you can do to help it out.  Can you get rid of
> the additional join to account_move?  (Note that the one I'm
> suspecting is extra is the LEFT JOIN, not the IN.)  I'd also
> counsel losing the ORDER BY in the sub-select, as that's either
> going to be ignored altogether or force a probably-useless sort,
> not to mention creating an optimization barrier.

Unfortunately, the SQL is generated by Odoo's ORM, and as much as I'd
like to be able to 'help it', their code has too many feature-hooks
for me to easily hack their code ... Odoo has used Postgresql as it s
database since its inception back in 2008. It is just unfortunate that
it has hit this stumbling block with the latest version of the
planner.

Cheers.
-- 
Jonathan Chen <jonc@chen.org.nz>



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgresql 13 query engine regression
Next
From: Jonathan Chen
Date:
Subject: Re: Postgresql 13 query engine regression