Re: don't allocate HashAgg hash tables when running explain only

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Alexey Bashtanov <bashtanov(at)imap(dot)cc>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: don't allocate HashAgg hash tables when running explain only
Date: 2020-11-18 10:40:24
Message-ID: c3f20c95-4a41-f94b-c635-ebe5db0705e3@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13/11/2020 18:10, Alexey Bashtanov wrote:
> Hi,
>
> I got somewhat scared when my explain took a few seconds to complete and
> used a few gigs of RAM.
> To reproduce try the following:
>
> discard temp;
> create temp table a as select to_timestamp(generate_series(1, 7000)) i;
> analyze a;
> set work_mem to '3GB';
> explain select distinct a1.i - a2.i from a a1, a a2;
>
> I would appreciate if someone could have a look at the patch attached,
> which makes executor skip initializing hash tables when doing explain only.

Makes sense. Committed, thanks for the patch!

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2020-11-18 10:56:38 Devel docs on website reloading
Previous Message Masahiko Sawada 2020-11-18 10:27:54 Re: VACUUM (DISABLE_PAGE_SKIPPING on)