Re: [GENERAL] Perfomance of IN-clause with many elements and possiblesolutions - Mailing list pgsql-general

From Dmitry Lazurkin
Subject Re: [GENERAL] Perfomance of IN-clause with many elements and possiblesolutions
Date
Msg-id 7a3bdac6-d562-8173-e8c6-09a9a5bc4876@gmail.com
Whole thread Raw
In response to Re: [GENERAL] Perfomance of IN-clause with many elements and possible solutions  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: [GENERAL] Perfomance of IN-clause with many elements and possible solutions  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: [GENERAL] Perfomance of IN-clause with many elements and possible solutions  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-general
On 25.07.2017 00:31, David G. Johnston wrote:

Basically you want to write something like:

SELECT *
FROM ids
JOIN ( :values_clause ) vc (vid) ON (vc.vid = ids.id)​

or 

WITH vc AS (SELECT vid FROM .... ORDER BY ... LIMIT )
SELECT *
FROM ids
JOIN vc ON (vid = ids.id)


This query uses JOIN plan node as IN (VALUES ...).

And I have one question. I don't understand why IN-VALUES doesn't use Semi-Join? PostgreSQL has Hash Semi-Join...  For which task the database has node of this type?

pgsql-general by date:

Previous
From: Dmitry Lazurkin
Date:
Subject: Re: [GENERAL] Perfomance of IN-clause with many elements and possiblesolutions
Next
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] Perfomance of IN-clause with many elements and possible solutions