From: | Давыдов Виталий <v(dot)davydov(at)postgrespro(dot)ru> |
---|---|
To: | "Aleksander Alekseev" <aleksander(at)timescale(dot)com> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org, "Vitaly Davydov" <vitprof(at)gmail(dot)com> |
Subject: | Re: How to accurately determine when a relation should use local buffers? |
Date: | 2023-11-22 10:29:30 |
Message-ID: | 242bdb-655dd800-3-6e134d00@180535496 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi Aleksander,
Thank you for your answers. It seems, local buffers are used for temporary relations unconditionally. In this case, we may check either relpersistence or backend id, or both of them.
I didn't do a deep investigation of the code in this particular aspect but that could be a fair point. Would you like to propose a refactoring that unifies the way we check if the relation is temporary?I would propose not to associate temporary relations with local buffers. I would say, that we that we should choose local buffers only in a backend context. It is the primary condition. Thus, to choose local buffers, two checks should be succeeded:
* relpersistence (RelationUsesLocalBuffers) * backend id (SmgrIsTemp)I know, it may be not as effective as to check relpersistence only, but it makes the internal architecture more flexible, I believe.
With best regards,
Vitaly Davydov
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2023-11-22 10:38:49 | Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION |
Previous Message | Xiang Gao | 2023-11-22 10:16:44 | RE: CRC32C Parallel Computation Optimization on ARM |