Re: postgres_fdw: using TABLESAMPLE to collect remote sample - Mailing list pgsql-hackers

From Tom Lane
Subject Re: postgres_fdw: using TABLESAMPLE to collect remote sample
Date
Msg-id 951485.1672461744@sss.pgh.pa.us
Whole thread Raw
In response to Re: postgres_fdw: using TABLESAMPLE to collect remote sample  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: postgres_fdw: using TABLESAMPLE to collect remote sample  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
List pgsql-hackers
Tomas Vondra <tomas.vondra@enterprisedb.com> writes:
> After thinking about it a bit more I decided to rip out the 10% sampling
> rate inflation.

+1.  I'm not sure if there's anything more we need to do there, but
that didn't seem like that was it.

I notice that the committed patch still has a reference to that hack
though:

+            * Ensure the sampling rate is between 0.0 and 1.0, even after the
+            * 10% adjustment above.  (Clamping to 0.0 is just paranoia.)

Clamping still seems like a wise idea, but the comment is just
confusing now.

Also, I wonder if there is any possibility of ANALYZE failing
with

ERROR:  TABLESAMPLE clause can only be applied to tables and materialized views

I think the patch avoids that, but only accidentally, because
reltuples will be 0 or -1 for a view.  Maybe it'd be a good
idea to pull back relkind along with reltuples, and check
that too?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: [PATCH] random_normal function
Next
From: jian he
Date:
Subject: Re: Infinite Interval