Re: Optimizing DISTINCT with LIMIT

Поиск
Список
Период
Сортировка
От Grzegorz Jaskiewicz
Тема Re: Optimizing DISTINCT with LIMIT
Дата
Msg-id 1E3782D0-1A9D-4C28-A307-F06E767312AA@pointblue.com.pl
обсуждение исходный текст
Ответ на Re: Optimizing DISTINCT with LIMIT  (David Lee Lambert <davidl@lmert.com>)
Ответы Re: Optimizing DISTINCT with LIMIT  (Greg Stark <greg.stark@enterprisedb.com>)
Список pgsql-hackers
On 2008-12-06, at 11:29, David Lee Lambert wrote:
>>
>
> I use "ORDER BY random() LIMIT :some_small_number" frequently to get  
> a "feel"
> for data.  That always builds the unrandomized relation and then  
> sorts it.  I
> guess an alternate path for single-table queries would be to  
> randomly choose
> a block number and then a tuple number;  but that would be biased  
> toward long
> rows (of which fewer can appear in a block).

but that's going to be extremely slow, due to speed of random()  
function.



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

Предыдущее
От: Martin Pihlak
Дата:
Сообщение: Re: SQL/MED compatible connection manager
Следующее
От: "Robert Haas"
Дата:
Сообщение: benchmarking the query planner (was Re: Simple postgresql.conf wizard)