Re: Question regarding indices

Поиск
Список
Период
Сортировка
От Lew
Тема Re: Question regarding indices
Дата
Msg-id i6g60e$345$1@news.albasani.net
обсуждение исходный текст
Ответ на Question regarding indices  ("Steve" <steeeeeveee@gmx.net>)
Ответы Re: Question regarding indices
Список pgsql-sql
On 09/11/2010 08:29 AM, Steve wrote:
> I have a small question about the order of values in a query.
> Assume I have a table with the following fields:
>    uid INT,
>    data BIGINT,
>    hits INT
> And an unique index on (uid, data). I use libpq C API to query
> data from the table. The query is something like this:
> SELECT uid,data,hits FROM mytable WHERE uid=2
> AND data IN (2033,2499,590,19,201,659)
>
> Would the speed of the query be influenced if I would sort the data?

What do you mean by "sort the data"?  Which data?

> I can imagine that just querying a bunch of bigint would not make a
> big difference but what about several thousand of values? Would sorting
> them and sending the SQL query with ordered data influence the speed of the query?

Send the query from where to where?

Are you referring to a sort of the items in the IN subselect?  My guess is 
that sorting that won't matter but it's only a WAG.

-- 
Lew


В списке pgsql-sql по дате отправления:

Предыдущее
От: Nathan Grange
Дата:
Сообщение: 9.0rc1 - query of view produces unexpected results
Следующее
От: "Steve"
Дата:
Сообщение: Re: Question regarding indices