Re: Ideas about a better API for postgres_fdw remote estimates

From: "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)2ndquadrant(dot)com>
Subject: Re: Ideas about a better API for postgres_fdw remote estimates
Date: 2020-09-03 05:14:41
Message-ID: ac237104-efe6-e0c7-5e48-ce508f602f69@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/31/20 6:19 PM, Ashutosh Bapat wrote:
> On Mon, Aug 31, 2020 at 3:36 PM Andrey V. Lepikhov
> <a(dot)lepikhov(at)postgrespro(dot)ru> wrote:
>>
>> Thanks for this helpful feedback.
> I think the patch has some other problems like it works only for
> regular tables on foreign server but a foreign table can be pointing
> to any relation like a materialized view, partitioned table or a
> foreign table on the foreign server all of which have statistics
> associated with them. I didn't look closely but it does not consider
> that the foreign table may not have all the columns from the relation
> on the foreign server or may have different names. But I think those
> problems are kind of secondary. We have to agree on the design first.
>
In accordance with discussion i made some changes in the patch:
1. The extract statistic routine moved into the core.
2. Serialized stat contains 'version' field to indicate format of
statistic received.
3. ANALYZE and VACUUM ANALYZE uses this approach only in the case of
implicit analysis of the relation.

I am currently keeping limitation of using the approach for regular
relations only, because i haven't studied the specifics of another types
of relations.
But I don't know any reason to keep this limit in the future.

The patch in attachment is very raw. I publish for further substantive
discussion.

--
regards,
Andrey Lepikhov
Postgres Professional

Attachment Content-Type Size
v2-0001-Pull-statistic-for-a-foreign-table-from-remote-serve.patch text/x-patch 50.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-09-03 05:35:06 Re: Switch to multi-inserts for pg_depend
Previous Message Thomas Munro 2020-09-03 05:08:48 Re: A micro-optimisation for walkdir()