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

From Qi Huang
Subject Re: Gsoc2012 idea, tablesample
Date
Msg-id BAY159-W2914D3B136B8733DCFD1A7A33F0@phx.gbl
Whole thread Raw
In response to Re: Gsoc2012 idea, tablesample  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Gsoc2012 idea, tablesample  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
> > 2. It's not very useful if it's just a dummy replacement for "WHERE
> > random() < ?". It has to be more advanced than that. Quality of the
> > sample is important, as is performance. There was also an
> > interesting idea of on implementing monetary unit sampling.

> In reviewing this, I got the impression (perhaps mistaken..), that
> different sampling methods are defined by the SQL standard and that it
> would simply be us to implement them according to what the standard
> requires.

> > I think this would be a useful project if those two points are taken
> > care of.

> Doing it 'right' certainly isn't going to be simply taking what Neil did
> and updating it, and I understand Tom's concerns about having this be
> more than a hack on seqscan, so I'm a bit nervous that this would turn
> into something bigger than a GSoC project.


As Christopher Browne mentioned, for this sampling method, it is not possible without scanning the whole data set. It improves the sampling quality but increases the sampling cost. I think it should also be using only for some special sampling types, not for general. The general sampling methods, as in the SQL standard, should have only SYSTEM and BERNOULLI methods. 

Best Regards and Thanks
Huang Qi Victor
Computer Science of National University of Singapore

pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Gsoc2012 idea, tablesample
Next
From: Stephen Frost
Date:
Subject: Re: Gsoc2012 idea, tablesample