Hi Amit On Mon, May 28, 2018 at 4:25 AM, Amit Kapila <amit.kapil...@gmail.com> wrote: > > This is one way, but I think there are other choices as well. We can > identify and flush all the dirty (local) buffers for the relation > being accessed parallelly. Now, once the parallel operation is > started, we won't allow performing any write operation on them. It
We talked about this in person in Ottawa and it was great meeting you! To summarize, the above proposal to continue using local buffers for temp tables is a step forward, however, it enables only certain kinds of queries to be parallelized for temp tables. E.g. queries changing a temp table in any way cannot be parallelized due to the restriction of no writes during parallel operation. > > Yeah, I think cases, where we need to drop temp relations, will become > costlier as they have to traverse all the shared buffers instead of > just local buffers. > This is a valid concern. The idea of using a radix tree of block numbers as proposed by Andres [1] is worth pursuing. Cost of identifying and dropping shared buffers belonging to a relation using radix tree would be reduced to O(log n). Asim [1] https://www.postgresql.org/message-id/20150912201941.GA8311%40alap3.anarazel.de