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 66821561-f2f6-21e4-8f91-37a2b23b768e@gmail.com
Whole thread Raw
In response to Re: [GENERAL] Perfomance of IN-clause with many elements and possible solutions  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: [GENERAL] Perfomance of IN-clause with many elements and possible solutions  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-general
On 08/01/2017 07:13 PM, Jeff Janes wrote:
I think that HashSet is a Java-specific term.  It is just a hash table in which there is no data to store, just the key itself (and probably a cash of the hashcode of that key), correct? 

Yes. And in Java HashSet implemented on top of HashMap (:

I think a more general solution would be to get the planner and executor to run the in-list query using the Hash Join, the same way it runs the in-VALUES one.

Have additional plan nodes big overhead?

I was impressed at how well the JSON and hstore worked, you might want to look at how they do it.  It is must be using an internal hash table of some sort.

JSONB and HSTORE keep sorted pairs and use binary search.

pgsql-general by date:

Previous
From: "Dan Cooperstock at Software4Nonprofits"
Date:
Subject: [GENERAL] Problem compiling a C function on Windows - not finding _palloc0@4
Next
From: Murtuza Zabuawala
Date:
Subject: Re: [HACKERS] [GENERAL] Not able to create collation on Windows