Re: using memoize in in paralel query decreases performance

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: using memoize in in paralel query decreases performance
Date: 2023-03-06 08:54:59
Message-ID: CAFj8pRBRvK2_EGeD7J_37ncax0x7Q==C=zTpg2WzM0uWnvaixg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

po 6. 3. 2023 v 9:16 odesílatel David Rowley <dgrowleyml(at)gmail(dot)com> napsal:

> On Mon, 6 Mar 2023 at 20:34, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> > In one query I can see very big overhead of memoize node - unfortunately
> with hits = 0
> >
> > The Estimate is almost very good. See details in attachment
>
> Are you able to share the version number for this?
>

15.1 - upgrade on 15.2 is planned this month

>
> Also, it would be good to see EXPLAIN ANALYZE *VERBOSE* for the
> memorize plan so we can see the timings for the parallel workers.
>

default https://explain.depesz.com/s/fnBe
disabled memoize https://explain.depesz.com/s/P2rP

> The results of:
>
> EXPLAIN ANALYZE
> SELECT DISTINCT ictc.sub_category_id
> FROM ixfk_ictc_subcategoryid ictc
> INNER JOIN item i ON i.item_category_id = ictc.sub_category_id
> WHERE ictc.super_category_id = ANY
> ('{47124,49426,49488,47040,47128}'::bigint[]);
>
>
https://explain.depesz.com/s/OtCl

would also be useful. That should give an idea of the ndistinct
> estimate. I guess memorize thinks there are fewer unique values than
> the 112 that were found. There's probably not much to be done about
> that. The slowness of the parallel workers seems like a more
> interesting thing to understand.
>
> David
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-03-06 09:02:55 Re: Allow tests to pass in OpenSSL FIPS mode
Previous Message Julien Rouhaud 2023-03-06 08:52:18 Re: Combine pg_walinspect till_end_of_wal functions with others