Re: Question regarding indices - Mailing list pgsql-sql

From Tom Lane
Subject Re: Question regarding indices
Date
Msg-id 20432.1284229328@sss.pgh.pa.us
Whole thread Raw
In response to Re: Question regarding indices  ("Steve" <steeeeeveee@gmx.net>)
List pgsql-sql
"Steve" <steeeeeveee@gmx.net> writes:
>> Von: Tom Lane <tgl@sss.pgh.pa.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


pgsql-sql by date:

Previous
From: "Steve"
Date:
Subject: Re: Question regarding indices
Next
From: Dmitriy Igrishin
Date:
Subject: Re: Question about PQexecParams