Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wPKEb-000eU1-34 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 May 2026 13:11:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPKEX-004L0j-27 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 May 2026 13:11:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wPKEX-004L0a-1E for pgsql-hackers@lists.postgresql.org; Tue, 19 May 2026 13:11:42 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wPKEV-00000000KZc-2Zek for pgsql-hackers@lists.postgresql.org; Tue, 19 May 2026 13:11:41 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-43d75312379so3060940f8f.1 for ; Tue, 19 May 2026 06:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779196299; x=1779801099; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=/3q68JDG11RVHfi9M9y2LC+0y5VcHfs3CyRoDDzjRcE=; b=nvx/sYuxi2INiVNXjmdTstCew6NuN0PXvjLbZOrsR1e8ZsgRHLZpYs2amXweA/MLrz 49XK/sA50XcGdACF2E+dVzz1OPvRiTRj5wylZpyq5aJcwmTNBxWRzb6yXmY0rLVOMQki KVNZhRayc9c50LfXG4WcJmVeLilFuqv50rmneDB1QbU+FmdrSNjvnoq/YbhX3UkWibdD MZ4xDBkXc01YgW5tjnKzayWbhhX9jQhhiNVJcYDxkh6FSDypnPiL/jXlf+Ghve+eecP0 eW2MTfhbUxP1sAZMD3/VsDf0G1i6avkYoEKhlDZHv2Cwrivyw9nLKlr3p7YfpUWdcYIT o3wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779196299; x=1779801099; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/3q68JDG11RVHfi9M9y2LC+0y5VcHfs3CyRoDDzjRcE=; b=iJuzPqRwSAjOnE3EMsoGy4t+3RyzPDihlusP9DD6MrWWAryNGcR4bYdCbpJApzd90f HXn9s8gOcDWY7z7XFgEq24mJY5miL0KmH9Cj/EtJ1kFbYYMJ3wFVqNFDeemVgUrTMt+T hV+wtZz5wY8MMO9Q/dXKSSka6cr5Rju6rZfMPPKhOFtXEeJBmcLI2ZA/GLDfsEzW6BP1 zRDl+Mu+oMHuQgljmlXOj0ROhJ6Cd0lUizPV5GpDImS8rzLiU7Dezfmf/pm9ld3EXIzR BkyCCYpWpiVJtwrkwfAl6gDUC42RJTIxdSVd28RpTvc273BtSscwhXfJfSnqp822g4K8 5BjQ== X-Gm-Message-State: AOJu0YzAXRFLB0nVkEP+88AgTf7hR9k9oVlkuOX+ES9506LHPcbdFhRy CgZTvEcsyUxOx1AMcYLnf+4VQxYi5ewtz03irO1VKa4pJwXKoA32AMWT X-Gm-Gg: Acq92OESns2zwwU3SvXtZha8c37xOaoeM4cuGN+ddK2BPKfaK5NiO7e5+874mweJ801 cBzu5diwaAqezPUkPNHp+MvzfLUPSXuagPa2C0BiPL4J1W7llpdeJ2wmigIS06NHL7K19GOhHN8 e3ycX0fL8MUAF/208ZLvBGbohLIhoSRnuhIviLEntBROnCLs+OVwIsHRR/hdpfBR5lcFYHjvBe0 oC5sqOXNORFX90Ejk+Gm/EvFPmnkxk6MWXQ0T604zwAsL7oshoL2fv7sRIwgEw7fPXzu4xjy34L gObghvScrE5MIt8Gd18hAxV0mu6Z/8yaIBIJr1mCs3dSpPWUXnhRiIaGjnXALAypibBngzCh+uB j51qOZQUeWyWW6nuO/FVFJrQ+mFOC7+QgtLxwrCRgvHRZnIHUHbttxUxDHQNZiPGsoxtdjEf0DK Vv1ugOHSzATdnmvIHXdLz7mUXI1fHj5blJR1SC X-Received: by 2002:a05:600c:1914:b0:48f:d620:c27f with SMTP id 5b1f17b1804b1-48fe4dac5efmr293760585e9.4.1779196298498; Tue, 19 May 2026 06:11:38 -0700 (PDT) Received: from [192.168.15.82] ([80.251.191.198]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fea52a0bfsm165033245e9.0.2026.05.19.06.11.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 May 2026 06:11:37 -0700 (PDT) Message-ID: <73cae1b4-75d0-4f55-b034-a1f9b7be61a2@gmail.com> Date: Tue, 19 May 2026 15:11:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Sequence Access Methods, round two From: Andrei Lepikhov To: Michael Paquier Cc: Postgres hackers , Xuneng Zhou , Chao Li , Peter Eisentraut , Kirill Reshke , Peter Smith References: <02699E3C-CC8B-423D-B36F-0AAA9370415E@gmail.com> <1F653C1D-A28D-4F3B-8B18-98F993F39B04@gmail.com> <433EABEB-0BBB-46E6-B2D2-226E9494A6D8@gmail.com> <4317C0A5-2210-40C1-93FE-FF618E3BC0D4@gmail.com> <688decf8-1e14-4ebc-869f-94e9ce6b53db@gmail.com> <8e63b447-9ebb-4873-973b-437b20c49881@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 18/05/2026 20:42, Andrei Lepikhov wrote: > On 18/05/2026 00:43, Michael Paquier wrote: > Ok. So let me just leave the idea of avoiding unnecessary cache lookups here. Here is my benchmark results. Test script: DROP SEQUENCE IF EXISTS abc; CREATE UNLOGGED SEQUENCE abc USING seqlocal; -- Warm up SELECT count(nextval('abc')) FROM generate_series(1, 1E6) \watch i=0 c=100 \timing on \o result.txt -- Benchmark SELECT count(nextval('abc')) FROM generate_series(1, 1E6) \watch i=0 c=100 To identify thermal impact I averaged and compared results per 20 iterations in a pack: | Window | Baseline | v29 | | ----------- | -------- | ------------ | | iter 1-20 | 236.92 | 235.28 | | iter 21-40 | 235.77 | 236.17 | | iter 41-60 | 238.53 | 234.64 | | iter 61-80 | 236.62 | 234.35 | | iter 81-100 | 237.13 | 235.24 | This test doesn't include insertion machinery itself, so no cold cache measures or sequence lock contention. pgbench results on the UNLOGGED table insertion shows the following: | Test | Baseline | v29 | Δ | | INSERT pgbench (mean tps) | 24,997 | 25,195 | +0.79% | My oldish Intel-based MacBook is probably not sensitive enough to detect the overhead. So, you can recheck the result using scripts [1] to restore the exact test. [1] https://github.com/danolivo/conf/tree/main/2026e-SeqAM -- regards, Andrei Lepikhov, pgEdge