Re: postgres_fdw: using TABLESAMPLE to collect remote sample

Finnerty, Jim <jfinnert@amazon.com>

From: James Finnerty <jfinnert@amazon.com>
To: pgsql-hackers@lists.postgresql.org
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Date: 2022-12-15T16:34:35Z
Lists: pgsql-hackers
This patch looks good to me.  I have two very minor nits: The inflation of the sample size by 10% is arbitrary but it doesn't seem unreasonable or concerning.  It just makes me curious if there are any known cases that motivated adding this logic.  Secondly, if the earliest non-deprecated version of PostgreSQL supports sampling, then you could optionally remove the logic that tests for that. The affected lines should be unreachable.

Commits

  1. Check relkind before using TABLESAMPLE in postgres_fdw

  2. Fix stale comment about sample_frac adjustment