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 1n21TA-0006vH-DQ for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Dec 2021 01:40:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n21T7-0004rb-JD for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Dec 2021 01:40:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n21T6-0004rG-UN for pgsql-hackers@lists.postgresql.org; Tue, 28 Dec 2021 01:40:01 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n21T2-0006ZU-Mm for pgsql-hackers@lists.postgresql.org; Tue, 28 Dec 2021 01:40:00 +0000 Received: by mail-ed1-x529.google.com with SMTP id j6so67726213edw.12 for ; Mon, 27 Dec 2021 17:39:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=ZsQf2A0MR8A0Y4uQ+rdzsv0/Gm/oKLIaznSmeKyzWMU=; b=Q6iXf5yhQfBHoCDls06wPVvp6qlke0J5R1obRp17/W3An+4K+nN6XZbhQiP9t0mKmj Wac9DcJBmmSn1LVG/5hnVWV1LSv8SQizzNx2NVbeLj5YtlzkhPmkGuiC2wWy9T7ds7Vr W5d4+luvQ1Mgf7FfLE+QNb5GwO/pGnWt6Gs97Prx5XxyhWC8lWDBhuMMfa1kYkfiduru O9XTUx4x3h8OlkAMY9si7F06jEafsS/pCPKYS5CKs9MdFlVot3QoTPDDXDzNGVlAZMYq irinTTUUlwekl+EWmqOE0HgYhKt5kY6YaVruoc6prhrGDRB1LaHSkROfhWxC0d1UDqmS paCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=ZsQf2A0MR8A0Y4uQ+rdzsv0/Gm/oKLIaznSmeKyzWMU=; b=7KUkwmhBF3dFQSeVfFnSwvQTrleiCYJqTMZCPLW8UfzY9xMxgo0aQr2MMwgoXy1X2G pE4NFB4pHJQjTrghfLjGAHHbrSsq6vxJs4rm/SKc7uklJcAg7iEmzi0C58ZI9yc3oITu 9UmJqTcfVWW4goFnBUsCrIoHNWX2cFbfnrc6IDbtVn8EcHqqG/utTDABQLK0vH55i4W8 E1CS/r/63js4yOxd1C9b5H6ZK3Mbmgwt1lenhmBvF/uwc0UmaLz2gvAFh3bopIVH5UmI 0ZG7LF3mUJVF6QE6J14beFdjn7QH2RK7waIBNKS37++8cyTglogL4gGgcYqe1vtRSo21 S+xQ== X-Gm-Message-State: AOAM530mVm6yl91E6rsP9UbMt2hy8EkBTv++tKko87RH9k26cWMmPXGu Z1TzMn5hJQXfGUlOR628IC6cIGEQbU3DhQ48aKdZvtB7SlbjJqxIEIqqR4wcRj7ldbWNH3r0M89 PldeQJpr6LKvwmf94mfV6U6Yw5hL7GMlHWFjf4vY3eJYzE0POftWEX5MLRCABt61fmxot2foLKa OemLmpWWjaiCchh4Dy4qMtzK5XDLSd2P3WJKTgvRzFUqHCcURx4hZE X-Google-Smtp-Source: ABdhPJzme9+EfR6/fExCvPFnUWoGQL6MZz+zJqBX1nQHfRRPKqrJcoHfdGIeNnxwMJjls1zwOrulFg== X-Received: by 2002:a05:6402:34ca:: with SMTP id w10mr18162374edc.106.1640655594710; Mon, 27 Dec 2021 17:39:54 -0800 (PST) Received: from [10.137.0.18] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id h4sm6749751eds.90.2021.12.27.17.39.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Dec 2021 17:39:54 -0800 (PST) Message-ID: <29ff7c1c-fdd2-d932-9146-7f372f9eae87@enterprisedb.com> Date: Tue, 28 Dec 2021 02:39:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: sequences vs. synchronous replication Content-Language: en-US To: Peter Eisentraut , Kyotaro Horiguchi Cc: masao.fujii@oss.nttdata.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org References: <20211224.143725.1750248643492340056.horikyota.ntt@gmail.com> <20211224.170451.116141220257426861.horikyota.ntt@gmail.com> <186288a9-f4c6-ca57-0fd4-dae743059892@enterprisedb.com> From: Tomas Vondra In-Reply-To: <186288a9-f4c6-ca57-0fd4-dae743059892@enterprisedb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/27/21 21:24, Peter Eisentraut wrote: > On 24.12.21 09:04, Kyotaro Horiguchi wrote: >> Still, as Fujii-san concerns, I'm afraid that some people may suffer >> the degradation the patch causes.  I wonder it is acceptable to get >> back the previous behavior by exposing SEQ_LOG_VALS itself or a >> boolean to do that, as a 'not-recommended-to-use' variable. > > There is also the possibility of unlogged sequences if you want to avoid > the WAL logging and get higher performance. But unlogged sequences are not supported: test=# create unlogged sequence s; ERROR: unlogged sequences are not supported And even if we did, what would be the behavior after crash? For tables we discard the contents, so for sequences we'd probably discard it too and start from scratch? That doesn't seem particularly useful. We could also write / fsync the sequence buffer, but that has other downsides. But that's not implemented either, and it's certainly out of scope for this patch. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company