Re: postgres_fdw batching vs. (re)creating the tuple slots

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgres_fdw batching vs. (re)creating the tuple slots
Date: 2021-05-30 23:17:11
Message-ID: 2433405.1622416631@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2021-05-30 17:10:59 -0400, Tom Lane wrote:
>> But it does seem like the hashing scheme somebody added to resowners
>> is a bit too simplistic. It ought to be able to cope with lots of
>> refs to the same object, or at least not be extra-awful for that case.

> It's not really the hashing that's the problem, right? The array
> representation would have nearly the same problem, I think?

ResourceArrayAdd would have zero problem. ResourceArrayRemove is
O(1) as long as resources are removed in reverse order ... which
is effectively true if they're all the same resource. So while
I've not tested, I believe that this particular case would have
no issue at all with the old resowner implementation, stupid
though that was.

> It doesn't seem trivial to improve it without making resowner.c's
> representation a good bit more complicated.

Dunno, I have not studied the new version at all.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-05-31 00:14:36 Re: be-secure-gssapi.c and auth.c with setenv() not compatible on Windows
Previous Message Thomas Munro 2021-05-30 22:31:42 Re: O_DIRECT on macOS