Re: Performance improvement for queries with IN clause - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: Performance improvement for queries with IN clause
Date
Msg-id 8e269187-216d-d9b1-a79c-c95cb1e95d60@proxel.se
Whole thread Raw
In response to Performance improvement for queries with IN clause  (Rafia Sabih <rafia.pghackers@gmail.com>)
Responses Re: Performance improvement for queries with IN clause  (Amit Kapila <amit.kapila16@gmail.com>)
Re: Performance improvement for queries with IN clause  (Rafia Sabih <rafia.pghackers@gmail.com>)
List pgsql-hackers
On 11/8/19 2:52 PM, Rafia Sabih wrote:
> Now, my question is shouldn't we always use this list in sorted order, 
> in other words can there be scenarios where such a sorting will not 
> help? I am talking about only the cases where the list consists of all 
> constants and could fit in memory. Basically, when we are 
> transforming the in expression and found that it consists of all 
> constants, then sort it as well, codewise at transfromAExprIn, of course 
> there might be better ways to accomplish this.
> 
> So, your thoughts, opinions, suggestions are more than welcome.

If it is worth sorting them should depend on the index, e.g. for hash 
indexes sorting would just be a waste of time.

Andreas



pgsql-hackers by date:

Previous
From: Dent John
Date:
Subject: Re: The flinfo->fn_extra question, from me this time.
Next
From: Tomas Vondra
Date:
Subject: Re: ssl passphrase callback