Re: Gsoc2012 idea, tablesample - Mailing list pgsql-hackers

From Sandro Santilli
Subject Re: Gsoc2012 idea, tablesample
Date
Msg-id 20120419075626.GC21317@gnash
Whole thread Raw
In response to Re: Gsoc2012 idea, tablesample  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Gsoc2012 idea, tablesample
List pgsql-hackers
On Tue, Apr 17, 2012 at 04:29:52PM -0400, Stephen Frost wrote:
> Josh,
> 
> * Josh Berkus (josh@agliodbs.com) wrote:
> > FWIW, the PostGIS folks would *really* love to have a TABLESAMPLE which
> > worked with geographic indexes.  This would be tremendously useful for
> > constructing low-resolution "zoom out" tiles on maps and similar.
> 
> I'm familiar with the concept of 'zoom out' tiles and PostGIS, but I
> don't actually see the connection between that and TABLESAMPLE.  Perhaps
> I'm missing something, but I've never seen a case where you create 'zoom
> out' tiles by just grabbing some portion of the data at random, as that
> would end up creating empty spots or missing pieces.

Actually a random sample would really be representative of the data
distribution. What the type analyzer gets is a sample and that sample
is what the estimator looks at to answer the question:
How many rows fall in this rectangle ?

You can see how well it works by passing your queries using && operator
to "EXPLAIN ANALYZE" and compare estimated/real.

I'm looking for a way to fetch random samples these days so I confirm
the need for a quick way to fetch the same sample that "analyze"
command fetches but at SQL level.

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



pgsql-hackers by date:

Previous
From: Susanne Ebrecht
Date:
Subject: Re: Bug tracker tool we need
Next
From: Jeff Davis
Date:
Subject: Re: 9.3 Pre-proposal: Range Merge Join