Re: How to accurately determine when a relation should use local buffers? - Mailing list pgsql-hackers

From Давыдов Виталий
Subject Re: How to accurately determine when a relation should use local buffers?
Date
Msg-id 242bdb-655dd800-3-6e134d00@180535496
Whole thread Raw
In response to Re: How to accurately determine when a relation should use local buffers?  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: How to accurately determine when a relation should use local buffers?
List 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



 

pgsql-hackers by date:

Previous
From: Xiang Gao
Date:
Subject: RE: CRC32C Parallel Computation Optimization on ARM
Next
From: Amit Kapila
Date:
Subject: Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION