From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: James Finnerty <jfinnert@amazon.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: postgres_fdw: using TABLESAMPLE to collect remote sample
Date: Fri, 30 Dec 2022 23:42:24 -0500
Message-ID: <951485.1672461744@sss.pgh.pa.us> (raw)
In-Reply-To: <6da357b0-fdd3-095d-a06c-87666f4a5a8c@enterprisedb.com>
References: <151e835f-55d6-ddbc-b5b4-07ee606aba44@enterprisedb.com>
<03182011-10a4-97b4-7c70-d99aa1c11eed@enterprisedb.com>
<167112207543.1120.12195641719862911275.pgcf@coridan.postgresql.org>
<3377008.1671122816@sss.pgh.pa.us>
<cd3f2fda-d4cc-4371-210f-fc339d53b885@enterprisedb.com>
<6da357b0-fdd3-095d-a06c-87666f4a5a8c@enterprisedb.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, tomas.vondra@enterprisedb.com, jfinnert@amazon.com, pgsql-hackers@lists.postgresql.org
Subject: Re: postgres_fdw: using TABLESAMPLE to collect remote sample
In-Reply-To: <951485.1672461744@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox