Re: Keeping temporary tables in shared buffers

From: Asim Praveen <apraveen(at)pivotal(dot)io>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, David Kimura <dkimura(at)pivotal(dot)io>
Subject: Re: Keeping temporary tables in shared buffers
Date: 2018-06-02 21:18:17
Message-ID: CANXE4TfYcHTVPkVR+aQ9o+fPyw0KBEuk36sV8qZetCLAe_4b5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Amit

On Mon, May 28, 2018 at 4:25 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-06-02 21:20:57 Re: pg_config.h.win32 missing a set of flags from pg_config.h.in added in v11 development
Previous Message Jeff Janes 2018-06-02 21:16:51 Re: why partition pruning doesn't work?