Re: BUG #18851: Queries with xxx NOT IN (SELECT xxx FROM table) fail to run (or run very slowly) on v17 (v14 ok)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: joan(at)sanchezsabe(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18851: Queries with xxx NOT IN (SELECT xxx FROM table) fail to run (or run very slowly) on v17 (v14 ok)
Date: 2025-03-14 16:56:54
Message-ID: 3086084.1741971414@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> I have experienced a misbehaviour (IMHO) in PostgreSQL 17 that didn't occur
> in PostgreSQL 14.

What have you got work_mem set to in the two installations?

For me, both versions switch to the cheap hashed plan if work_mem
is large enough that the inner table is estimated to fit in it
(somewhere around 10MB-20MB for this specific example). If anything
the newer code seems to have a smaller threshold.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2025-03-14 22:10:27 Re: BUG #18845: DEREF_OF_NULL.RET guc_malloc possibly returns NULL
Previous Message Tom Lane 2025-03-14 16:18:42 Re: ISN extension - wrong volatility level for isn_weak() function