Re: Question regarding indices

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Steve" <steeeeeveee(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Question regarding indices
Date: 2010-09-11 18:22:08
Message-ID: 20432.1284229328@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Steve" <steeeeeveee(at)gmx(dot)net> writes:
>> Von: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>> It's unlikely to make enough difference to be worth the trouble.
>>
> Making a quick sort is ultra easy in C. Anyway... is there a
> difference in the speed of the query with pre-sorted values or not?
> If there is one then I will go and sort the values.

I didn't opine on whether it was "easy" or not. I said it was unlikely
to be worth the trouble. You could very well spend more time sorting
the values than you buy in whatever you might save on the server side.

Each value in the IN list is going to require a separate index probe.
The sorting might buy something in locality of reference for successive
probes, but most likely not enough to notice.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitriy Igrishin 2010-09-11 21:52:04 Re: Question about PQexecParams
Previous Message Steve 2010-09-11 17:23:32 Re: Question regarding indices