Re: [Patch] Optimize dropping of relation buffers using dlist

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: "k(dot)jamison(at)fujitsu(dot)com" <k(dot)jamison(at)fujitsu(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "tanghy(dot)fnst(at)cn(dot)fujitsu(dot)com" <tanghy(dot)fnst(at)cn(dot)fujitsu(dot)com>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "jankirk(dot)jamison(at)gmail(dot)com" <jankirk(dot)jamison(at)gmail(dot)com>
Subject: Re: [Patch] Optimize dropping of relation buffers using dlist
Date: 2021-03-12 04:20:27
Message-ID: CAA4eK1JCOOTU_rOnrp=nGxHah14vexC20Nyz2TEtKnjtNuBQ=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 12, 2021 at 4:58 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
>
> While rebasing CF #2933 (which drops the _cached stuff and makes this
> optimisation always available, woo), I happened to notice that we're
> summing the size of many relations and forks into a variable
> nBlocksToInvalidate of type BlockNumber. That could overflow.
>

I also think so. I think we have two ways to address that: (a) check
immediately after each time we add blocks to nBlocksToInvalidate to
see if it crosses the threshold value BUF_DROP_FULL_SCAN_THRESHOLD and
if so, then just break the loop; (b) change the variable type to
uint64.

Any better ideas?

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-03-12 04:22:23 Re: [HACKERS] Custom compression methods
Previous Message Dilip Kumar 2021-03-12 04:08:14 Re: [HACKERS] Custom compression methods