Re: Simple IN vs IN values performace

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Simple IN vs IN values performace
Date: 2021-02-23 02:33:27
Message-ID: CAHOFxGqNBsD6vktSw3ZB2CXDTY5N-YxmkwSmCjwxXOAANOKbdg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> Insert the values into a TEMPORARY TABLE, then join that to your main
> table?
>

In my experience, this is very performant but needs an analyze command
after populating the temp table to ensure there are statistics so the plan
doesn't go awry. Otherwise, I'm not sure it is different from a
materialized CTE or a subquery with OFFSET 0 at the end.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Wheeler 2021-02-23 03:32:11 Permission inconsistency with views that call functions
Previous Message Santosh Udupi 2021-02-23 02:20:47 Re: pg_restore - generated column - not populating