From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steve <steeeeeveee@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Question regarding indices
Date: Sat, 11 Sep 2010 14:22:08 -0400
Message-ID: <20432.1284229328@sss.pgh.pa.us> (raw)
In-Reply-To: <20100911172332.240150@gmx.net>
References: <20100911122923.75010@gmx.net>
<17448.1284217456@sss.pgh.pa.us>
<20100911172332.240150@gmx.net>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, steeeeeveee@gmx.net
Subject: Re: Question regarding indices
In-Reply-To: <20432.1284229328@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox