Re: Import Statistics in postgres_fdw before resorting to sampling.
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
To: Corey Huinker <corey.huinker@gmail.com>
Cc: Etsuro Fujita <etsuro.fujita@gmail.com>,
Michael Paquier <michael@paquier.xyz>, pgsql-hackers@postgresql.org, jkatz@postgresql.org, nathandbossart@gmail.com
Date: 2026-01-09T09:35:11Z
Lists: pgsql-hackers
On Wed, Jan 7, 2026 at 11:34 AM Corey Huinker <corey.huinker@gmail.com> wrote: > > Anyway, here's v8, incorporating the documentation feedback and Matheus's notes. I went through the patches. I have one question: The column names of the foreign table on the local server are sorted using qsort, which uses C sorting. The column names the result obtained from the foreign server are sorted using ORDER BY clause. If the default collation on the foreign server is different from the one used by qsort(), the merge sort in import_fetched_statistics() may fail. Shouldn't these two sorts use the same collation? Some minor comments /* avoid including explain_state.h here */ typedef struct ExplainState ExplainState; - unintended line deletion? fetch_remote_statistics() fetches the statistics twice if the first attempt fails. I think we need same check after the second attempt as well. The second attempt should not fail, but I think we need some safety checks and Assert at least, in case the foreign server misbehaves. -- Best Wishes, Ashutosh Bapat
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
postgres_fdw: Replace buffers in RemoteAttributeMapping with pointers.
- aa1f93a3387a 19 (unreleased) landed
-
Add support for importing statistics from remote servers.
- 28972b6fc3dc 19 (unreleased) landed