Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUP2M-0006kx-Ae for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Apr 2021 07:25:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lUP2K-0001YS-Ny for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Apr 2021 07:25:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUP2K-0001YL-DK for pgsql-hackers@lists.postgresql.org; Thu, 08 Apr 2021 07:25:08 +0000 Received: from forwardcorp1j.mail.yandex.net ([2a02:6b8:0:1619::183]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUP2G-0002EQ-Be for pgsql-hackers@postgresql.org; Thu, 08 Apr 2021 07:25:07 +0000 Received: from sas1-ec30c78b6c5b.qloud-c.yandex.net (sas1-ec30c78b6c5b.qloud-c.yandex.net [IPv6:2a02:6b8:c14:2704:0:640:ec30:c78b]) by forwardcorp1j.mail.yandex.net (Yandex) with ESMTP id B82CD2E157E; Thu, 8 Apr 2021 10:24:57 +0300 (MSK) Received: from sas1-9d43635d01d6.qloud-c.yandex.net (sas1-9d43635d01d6.qloud-c.yandex.net [2a02:6b8:c08:793:0:640:9d43:635d]) by sas1-ec30c78b6c5b.qloud-c.yandex.net (mxbackcorp/Yandex) with ESMTP id crq7pMv3Ee-Ou0qmd2X; Thu, 08 Apr 2021 10:24:57 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1617866697; bh=LO7T7tc8Bk7Og1nry9QOcifbzBHro38oAuVnQiljhrc=; h=To:Message-Id:References:Date:Subject:Cc:In-Reply-To:From; b=JhRbKeLVXqFjOSScX+EeBTiDd1E59hM9rFGTtDd1OgxO4Up+xai0Nax0L9kwRzq0O VuX4XDvHI7U5zDeLjJf4hwuN0gh64GyyKny/yyBJey7qnRFsbaNgYAbxg2w0wy56nt pyv7AqcB9qlIA+fglan/zaTPHx29EmYfyVH8i2U8= Authentication-Results: sas1-ec30c78b6c5b.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-vpn.dhcp.yndx.net (dynamic-vpn.dhcp.yndx.net [2a02:6b8:b080:8121::1:f]) by sas1-9d43635d01d6.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id o6eSJg8j0W-OuoiKSox; Thu, 08 Apr 2021 10:24:56 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: MultiXact\SLRU buffers configuration From: Andrey Borodin In-Reply-To: Date: Thu, 8 Apr 2021 10:24:55 +0300 Cc: Gilles Darold , Tomas Vondra , Tomas Vondra , Alexander Korotkov , Anastasia Lubennikova , Daniel Gustafsson , Kyotaro Horiguchi , pgsql-hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <20201028013651.de5cj2xadgmba5nf@development> <13D8FD63-559A-4737-B7FD-05288D1CEF8B@yandex-team.ru> <20201028233243.ygm6yqlynkqpzekr@development> <43F3DE92-F236-4EA5-B4D6-39BEF6BD849D@yandex-team.ru> <20201029134933.xd4mh2cofuf6tdfz@development> <65C1B4BA-D16F-4939-978B-AC8F370F5A5E@yandex-team.ru> <9b4d17df-b811-8323-16be-3cab913216d1@enterprisedb.com> <35862787-8b4d-a290-789e-6e12dc6527e8@enterprisedb.com> <13F86913-C01B-4983-AE2E-493F5A028280@yandex-team.ru> <6ba7eae2-8b0c-0690-11a5-e921e6586180@darold.net> <3F5E23A3-6250-486E-9CCA-E2A5B6A28B4F@yandex-team.ru> <636f694a-4d69-d6d9-78d1-c88714f3e2e0@darold.net> <3319917a-679e-b07d-b194-473552b72082@darold.net> <1E3DD5BF-A54E-4203-86C5-94C9EFA0E095@yandex-team.ru> <04ae150b-6442-148a-bb23-77082f6fca1d@darold.net> <3768803E-4794-409D-88D2-C3EF7CA1B7FC@yandex-team.ru> <75B95FDD-2BE0-4525-8BDD-FC67C8BCBD53@yandex-team.ru> <88CB7042-6181-4EF4-8B25-61EC5E5725D4@yandex-team.ru> <018EF641-FC9D-4BA9-A458-6842E27E91C2@yandex-team.ru> <27D90FFC-B897-4BC5-B4F5-9047B9886AA3@yandex-team.ru> <15CA416B-3446-462D-902B-4883DD3ADEE6@yandex-team.ru> To: Thomas Munro X-Mailer: Apple Mail (2.3608.120.23.2.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > 8 =D0=B0=D0=BF=D1=80. 2021 =D0=B3., =D0=B2 03:30, Thomas Munro = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0= ): >=20 > Here's another approach that is a little less exciting than > "tournament RR" (or whatever that should be called; I couldn't find an > established name for it). This version is just our traditional linear > search, except that it stops at 128, and remembers where to start from > next time (like a sort of Fisher-Price GCLOCK hand). This feels more > committable to me. You can argue that all buffers above 128 are bonus > buffers that PostgreSQL 13 didn't have, so the fact that we can no > longer find the globally least recently used page when you set > xact_buffers > 128 doesn't seem too bad to me, as an incremental step > (but to be clear, of course we can do better than this with more work > in later releases). I agree that this version of eviction seems much more effective and less = intrusive than RR. And it's still LRU, which is important for subsystem = that is called SLRU. shared->search_slotno is initialized implicitly with memset(). But this = seems like a common practice. Also comment above "max_search =3D Min(shared->num_slots, = MAX_REPLACEMENT_SEARCH);" does not reflect changes. Besides this patch looks good to me. Thanks! Best regards, Andrey Borodin.=