Re: Bug? Small samples in TABLESAMPLE SYSTEM returns zero rows - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Bug? Small samples in TABLESAMPLE SYSTEM returns zero rows
Date
Msg-id CANP8+j+R8pmBNKO8DJLf5+m5ezVrh9xTF_BaXZhLPPTHVOC=iA@mail.gmail.com
Whole thread Raw
In response to Bug? Small samples in TABLESAMPLE SYSTEM returns zero rows  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Bug? Small samples in TABLESAMPLE SYSTEM returns zero rows  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 6 August 2015 at 20:14, Josh Berkus <josh@agliodbs.com> wrote:
 
The results of 0, 185 and 925 are not.  It really seems like SYSTEM is
treating 0.04% as a maximum, but taking a random number of data pages
somewhere around that maximum, using math which can choose numbers of
pages far outside of the % requested by the user, and which includes 0.

Thanks for the report, I'll look at this now. 
 
Speaking from a user perspective, SYSTEM seems broken to me.  I can't
imagine using it for anything with a that degree of variation in the
number of results returned, especially if it's possible to return zero
rows from a populated table.

Please bear in mind you have requested a very small random sample of blocks.

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Bug? Small samples in TABLESAMPLE SYSTEM returns zero rows
Next
From: Tom Lane
Date:
Subject: Re: Bug? Small samples in TABLESAMPLE SYSTEM returns zero rows