On Fri, Feb 11, 2022 at 12:39 PM Tom Lane <t...@sss.pgh.pa.us> wrote: > Tomas Vondra <tomas.von...@enterprisedb.com> writes: > > So here we go. The patch does a very simple thing - it uses TABLESAMPLE > > to collect/transfer just a small sample from the remote node, saving > > both CPU and network. > > This is great if the remote end has TABLESAMPLE, but pre-9.5 servers > don't, and postgres_fdw is supposed to still work with old servers. > So you need some conditionality for that.
I think it's going to be necessary to compromise on that at some point. I don't, for example, think it would be reasonable for postgres_fdw to have detailed knowledge of which operators can be pushed down as a function of the remote PostgreSQL version. Nor do I think that we care about whether this works at all against, say, PostgreSQL 8.0. I'm not sure where it's reasonable to draw a line and say we're not going to expend any more effort, and maybe 15 with 9.5 is a small enough gap that we still care at least somewhat about compatibility. But even that is not 100% obvious to me. -- Robert Haas EDB: http://www.enterprisedb.com