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 1vvquq-006AGq-10 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Feb 2026 06:01:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvqup-0014Eu-0o for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Feb 2026 06:01:31 +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 1vvquo-0014Eg-2l for pgsql-hackers@lists.postgresql.org; Fri, 27 Feb 2026 06:01:30 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvqul-00000001Qy2-1Jnb for pgsql-hackers@lists.postgresql.org; Fri, 27 Feb 2026 06:01:29 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-3870902760cso16603591fa.3 for ; Thu, 26 Feb 2026 22:01:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772172087; cv=none; d=google.com; s=arc-20240605; b=R4DGA0GkMlxlR7pFtiOkoBvv+Ji4FsG++wUhfEnd853D5Sb5x6OCLyBRJEvpqTzamg b7xPwMXYNMNRTcciApXKMU/d7x0SDc+lXOSMXKAc8p/b4q/Qv2tV7btS2+/rcJkNk1Lv BXgwHiThxvE5yJFAEYAPEXE6MwyR9ntex5XWgJuWJDNCZ6UOp6u7GFNjXe1YZYye4iyD dxyLHbP+w3ETmB+N2Ut7wPwhVwvG9EwzbhDsS44119NTMxrqlHv4DTOaewxTPY95iats /TXtmwBdjs6V8sgWGz0sdZ+V9K1FXEZZxay7UFVk77SvjGswv4FPPJRnFyRh8Ek/tWv/ 3g1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mcn0spaYaW+cZcbDoz5iCgEOgngak5ipoytUahCotxI=; fh=+qs7GuCoVY+neEsgai97Zt79LLtkUa1sV5jQt8+JQf4=; b=Px3lXEbslP4LuLMS2yHy33go4Ve6hzAarVDf32yyLw20dKAI3rY4J5BjGIZ1h29dIv vwGHitlw2TUB8XRVgR7N93jEta+Pzmy2N7qsTRiP5ZcZ85soUXQSISdyDnUr51Ztx91J ks1CNae5A2/xR7jP+ujbPBw0ZC28X2cCeEaTZx+DYgu48dM/jq7Q5gtqc8iszlXUJf8Q 49rziufVrjAWLLunZWCPv9ZCdCdJhcGO7/xONPk5kxQ8Rzl1a0C/VscnuDbL/U7fKjyF l9Os394TbJLgW2U+Bm7INdwtJp6SPpfIcYwxsnyDBHuBY05pc7Xf7zukaJ6RIztP79DW pmZg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772172087; x=1772776887; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mcn0spaYaW+cZcbDoz5iCgEOgngak5ipoytUahCotxI=; b=WZfXCXTK2bgAQjrPkpKpfhXf0PDU6UEBZeTYoSa53U1tEcxtX+/knp/CwtGFkEsAsb EovBjhk/OkPjuJewql24Jbo+sTvx/nGYK7zhO8mhpHuDdmaO2dMg9Rh3GVIUo0I/pVn6 5kcFki4vizK09W+t/3GlNsliHX6xDVxwX+s3zLb2JOE1rU40YoAd9NtULQOVxsAvZwZS zEVS+A0zsAJYDeepEzVB1cRQq3ZT2h5CrHMaur0TTSST8GyLuqUc3+KqQgPoVSLmtq+H hXiJO9jJOMNQ9loFOI0LE6HQXZve6aBJD1D3NdFiLZI4vLjMhEfUloeEmE2XptYwXBMZ UTZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772172087; x=1772776887; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mcn0spaYaW+cZcbDoz5iCgEOgngak5ipoytUahCotxI=; b=v8/mZGwuzIAs0vi5UHndwvXc/l4xeQs1K2qZ80b8QOG0P3YijjiWUQvJW9RMgEU5cY F3mxBxcnoUMzAeD3G13OB7ayJ+oYpYNgAJDgLFuqhsn5GQFYcnXm0e5Qgk46KanBrP4/ r6LUjhtfUTKIKQUdc/ObWChNyJTz4o7kftJEaS8e2po5CjSryF9PoIBZIceBgExd4Drv RgRcQ1HmltkaVUGe2ZrnXFiJnjysV6cBi8qBllesExT05q/uvJqsv2EsnXClFHo5UNYY tN/hdVAh5pDDwrTvCUpoOA3K1g+UoP2N4VqaYbabb/TTe3WTxSm+gomHem9mlk27NAjW qL5Q== X-Forwarded-Encrypted: i=1; AJvYcCXrX74tNKG2qRmOo/nFpJrMiR0Lth+vbo0BfQyoRq8E6zsaDgykoRR2NyARnz9K1A91+cz/TGDJKAV39lU8@lists.postgresql.org X-Gm-Message-State: AOJu0Yy/zkvmMyxE5ik4Nw4EO7t4Bv3QfKm2JAgyZx2cMSzRmVuXIYAa GIF1XXFLFOG5K8Sxn55ZGeTxNsIrGoHU8iihjC611XpQbktAXGepuSHF8eOZ4c6LVohO8uUFTmG VCfodBKh096PO5gfTPSe5gYn2D6w/5KU= X-Gm-Gg: ATEYQzzJJcW9pBlmG/9ZXHxTRe1houVd43Em4SAcnYW915XQaHAWbGTKflObOujfUlB hfkzD6I3EFdPz7TucidU/847wNh2ixh/rw+VlrdCD2zX1nW4yGQzYMqyHkdX1aMm73koTzBziW0 NUZWarWJ9mhmsyfchTmdURoazH33u3IIDmvcuvyqujpP4T77TUsEUAJf2lFzdkHi+tnFvcCLu0U e03Xy0kIJkM41n+oxFNDjguDQfbm36EmtgwBRcxmHSmfnt76LElSMD6lsAyFezsAJN0/RAg6IXh LToWh6SqoqHdmC0dR1Zu5gwV7evgZkBL7UErHz4= X-Received: by 2002:a05:651c:f0a:b0:387:bf2:d87 with SMTP id 38308e7fff4ca-389ff34fbd7mr9539661fa.29.1772172086772; Thu, 26 Feb 2026 22:01:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Fri, 27 Feb 2026 11:31:14 +0530 X-Gm-Features: AaiRm50v0MtfrgVKLm2TrmSKST5mrI5GasEYkKFplQy47V0TRq2QfgAGNg5C-mk Message-ID: Subject: Re: [PATCH] Support automatic sequence replication To: Nisha Moond Cc: Ajin Cherian , "Hayato Kuroda (Fujitsu)" , shveta malik , Ashutosh Sharma , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Feb 26, 2026 at 7:43=E2=80=AFPM Nisha Moond wrote: > > On Thu, Feb 26, 2026 at 1:07=E2=80=AFPM Ajin Cherian = wrote: > > > > I also did some performance testing on HEAD to see how long REFRESH > > SEQUENCES takes for a large number of sequences. > > I ran these on a 2=C3=97 Intel Xeon E5-2699 v4 (22 cores each, 44 cores > > total / 88 threads) 512 GB RAM. I didn't see much value in > > differentiating between cases where half the sequences were different > > or all the sequences were different as REFRESH SEQUENCES updates all > > sequences after changing the state of all of them to INIT, it doesn't > > matter if they drifted or not. > > > > On HEAD: > > time to sync 10000 sequences: 1.080s (1080ms) > > time to sync 100000 sequences: 12.069s (12069ms) > > time to sync 1000000 sequences: 139.414s (139414ms) > > > > testing script attached (pass in the number of sequences as a run time > > parameter). > > Hi Ajin, > Thanks for sharing the performance results. I ran the same tests using > your scripts on a different machine with the configuration: > - Chip: Apple M4 Pro, 14 CPU cores > - RAM: 24 GB > - Postgres installation on pg_Head - commit 77c7a17a6e5 > > For these tests, I used shared_buffers =3D 4GB. The time taken for 1M > sequences is increased significantly: > time to sync 10000 sequences: .994s (994ms) > time to sync 100000 sequences: 11.032s (11032ms) > time to sync 1000000 sequences: 426.850s (426850ms) > > I also tested with shared_buffers =3D 8GB, and the time for 1M sequences > was 441.794s (441794 ms) > IIUC, the tests by Ajin and Nisha show the time to sync sequences varies from a few seconds to minutes depending on the number of sequences and machine configuration. This indicates that having an autosync worker can avoid downtime before upgrade, otherwise, users always need to use REFRESH SEQUENCES before upgrade. --=20 With Regards, Amit Kapila.