Re: Distinct performance dropped by multiple times in v16

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Vitaliy Litovskiy <vitaliy(dot)litovskiy(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Distinct performance dropped by multiple times in v16
Date: 2024-06-10 16:24:29
Message-ID: CAKAnmm+c3EvPB=SNczcnZ=qOJJP3SpyGGZeJhYGSKLcg0_rTVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Jun 10, 2024 at 3:32 AM Vitaliy Litovskiy <
vitaliy(dot)litovskiy(at)gmail(dot)com> wrote:

> 1. query runs for 4-5 seconds on v16 and less than a second on v15
>

Yeah, that's a big regression. Seeing the actual EXPLAIN ANALYZE output
for both systems would be very helpful to us. Also nice to see the plan if
you do a
SET enable_incremental_sort=0;
before running the query

I wonder if materializing things might help, something like

with
x as (select id, unnest(string_to_array(emp,';')) as token, refdate from
terr),
y as (select id, unnest(string_to_array(emp,';')) as token from employee)
select distinct x.id, y.id, refdate from x join y using (token);

(renamed to avoid all those mixed-case quoting)

Cheers,
Greg

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Andrei Lepikhov 2024-06-11 07:10:45 Re: Distinct performance dropped by multiple times in v16
Previous Message Vitaliy Litovskiy 2024-06-10 06:59:04 Distinct performance dropped by multiple times in v16