Re: How to make ResourceOwnerForgetBuffer() O(1), instead of O(N^2) scale - Mailing list pgsql-hackers

From Tom Lane
Subject Re: How to make ResourceOwnerForgetBuffer() O(1), instead of O(N^2) scale
Date
Msg-id 7838.1412310340@sss.pgh.pa.us
Whole thread Raw
In response to How to make ResourceOwnerForgetBuffer() O(1), instead of O(N^2) scale  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Responses Re: How to make ResourceOwnerForgetBuffer() O(1), instead of O(N^2) scale
List pgsql-hackers
Kouhei Kaigai <kaigai@ak.jp.nec.com> writes:
> Idea-1) Put ResourceOwnerForgetBuffer() O(1) logic, instead of O(N^2).
> The source of problem come from data structure in ResourceOwnerData,
> so a straightforward way is to apply O(1) logic based on hashing,
> instead of the linear search.

I will bet that this is a dead loss for all normal usage patterns,
because queries seldom have more than a few buffers pinned.  More
than that: I do not think we should encourage coding patterns that
pin lots of buffers.  There is no way that holding pins on thousands
of buffers to do one operation is a sane design.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: How to make ResourceOwnerForgetBuffer() O(1), instead of O(N^2) scale
Next
From: Claudio Freire
Date:
Subject: Re: DDL Damage Assessment