Re: Performance improvement for queries with IN clause

From: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Performance improvement for queries with IN clause
Date: 2019-11-11 09:14:26
Message-ID: CA+FpmFf1JtEXCB8j9uV2QFjN2utwgyFD2LnegHirtcmKw-YD-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 9 Nov 2019 at 12:52, Andreas Karlsson <andreas(at)proxel(dot)se> wrote:

> 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.

Hi Andreas,
Thanks for your response. Here, I meant this list sorting only for Btree,
as you well pointed out that for other indexes like hash this wouldn't
really make sense.

--
Regards,
Rafia Sabih

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mahendra Singh 2019-11-11 09:23:30 Re: [HACKERS] Block level parallel vacuum
Previous Message Antonin Houska 2019-11-11 09:03:14 Re: MarkBufferDirtyHint() and LSN update