Re: Gsoc2012 idea, tablesample

Поиск
Список
Период
Сортировка
От Sandro Santilli
Тема Re: Gsoc2012 idea, tablesample
Дата
Msg-id 20120424073136.GF7891@gnash
обсуждение исходный текст
Ответ на Re: Gsoc2012 idea, tablesample  (Sandro Santilli <strk@keybit.net>)
Ответы Re: Gsoc2012 idea, tablesample
Список pgsql-hackers
On Tue, Apr 24, 2012 at 08:49:26AM +0200, Sandro Santilli wrote:
> On Mon, Apr 23, 2012 at 08:34:44PM +0300, Ants Aasma wrote:

> > SELECT (SELECT reservoir_sample(some_table, 50) AS samples
> >    FROM some_table WHERE ctid =~ ANY (rnd_pgtids))
> > FROM random_pages('some_table', 50) AS rnd_pgtids;
> 
> But I don't understand the reservoir_sample call, what is it supposed to do ?

Ok got it, that was probably to avoid:
ERROR:  more than one row returned by a subquery used as an expression

But this also works nicely:
SELECT * FROM lots_of_pointsWHERE ctid = ANY ( ARRAY[(SELECT random_tids('lots_of_points', 100000))] );

and still uses tidscan.

The advanced TID operator would be for random_tids to only return pages rather
than full tids...

--strk; 
 ,------o-.  |   __/  |    Delivering high quality PostGIS 2.0 ! |  / 2.0 |    http://strk.keybit.net -
http://vizzuality.com`-o------'
 



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

Предыдущее
От: Nikhil Sontakke
Дата:
Сообщение: Re: B-tree page deletion boundary cases
Следующее
От: Boszormenyi Zoltan
Дата:
Сообщение: PL/PGSQL bug in handling composite types