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.94.2) (envelope-from ) id 1sU9i9-000ruz-C3 for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jul 2024 18:49:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sU9h8-004A8s-06 for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jul 2024 18:48:06 +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.94.2) (envelope-from ) id 1sU9h7-004A8j-Kl for pgsql-hackers@lists.postgresql.org; Wed, 17 Jul 2024 18:48:06 +0000 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sU9h5-00042z-Ha for pgsql-hackers@postgresql.org; Wed, 17 Jul 2024 18:48:04 +0000 Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-7f684af6af1so60357439f.2 for ; Wed, 17 Jul 2024 11:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721242083; x=1721846883; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=wr4zZPIiaDBT7FmI8TMuqe6pe0ooGWVo4ZZVQMBgiV8=; b=TnZ/i77qwjGgnT4hJQvOG20CdBJazg2Z5PTgLVYsn78K69jKOcVaButlE2Qc9PFNM2 ax+EQ0WZyk8NDuPuB78wvEr2fmVU61hmlX/Tg5i9bvUqYt2fOurugTxfp0ji7nT8ciZb QPeMY5Vz5Ym79OXm19OkpMJkVkY5aARe4u9JALcJzCiZre/lg3pBBEuQJCR2NqUXHaVk aZr499SQntZyK0OJjeZBCY3XDy4GBA4dGuHM1sdp/2bdEqn+XXuhDTjMZKh1ARgs1q1/ skncFaAH53584D5DaraI5UzzTrSSLB3jfX82Zwe7gWRgZVetnUsODNoRSl8v/3Nbte0p qnDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721242083; x=1721846883; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wr4zZPIiaDBT7FmI8TMuqe6pe0ooGWVo4ZZVQMBgiV8=; b=mrBRfSHfCRmmRkkhsSSamdlG/vrh/pJIj4ahtKeh5uHi3lXPLfdXLSIaVJl33FkQJM Q0zezwwFIejJNBKsBZtt/gB+WCdl5i3LpYNmn7RRMIV3Wn+XFV34g1uH7eCTeeUhTz0k 272Py87SFectIQ1y1t26Yubrlx/aq5lAYRzcSJgdDMtAvH67Mi/goB/P8kEh1U8unf2N dzDtczXHIgfoDcJBUu37+REMOtSzU3+cHPWP8suEPpkjDVK/MS4YdzB3l/eILQEGsaKp FgBu22tNyxDWeh2hE/BGiJDSZBfXpNlr+sNGTl3GAKn/EGHNUqDUem42wASgImb6wt7/ dCjQ== X-Forwarded-Encrypted: i=1; AJvYcCW5EPMKJrFo6GMeqvvCiHYal7PCF3csaZeXFtj0tOP2io7vshmEiFp4sBxJRLKTAqszQh3VBm1G6oT1kvrs1lb4rY4quhtnLT0qdcks X-Gm-Message-State: AOJu0YyNZQIXU1+q50P0CQm41opST+BgD2yEp/6qD1Y+pGzWN2sWWBPI NHpV+YMdIfSLh78EQIPoUlnnOOaUghYperqH9OmGdKW22obVii6h X-Google-Smtp-Source: AGHT+IFMFlVo4Bqo45YA9NymaJfQxICaZ7NGZn+GSrfv2Ovq1nAFBkroSPr9u2Rh2hGTmwsddyQDrw== X-Received: by 2002:a05:6602:3f82:b0:803:5e55:ecb3 with SMTP id ca18e2360f4ac-8170d214319mr338514839f.0.1721242082674; Wed, 17 Jul 2024 11:48:02 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4c210cc625asm857694173.77.2024.07.17.11.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jul 2024 11:48:02 -0700 (PDT) Date: Wed, 17 Jul 2024 13:48:00 -0500 From: Nathan Bossart To: Michael Paquier Cc: Euler Taveira , pgsql-hackers Subject: Re: improve performance of pg_dump with many sequences Message-ID: References: <20240503025140.GA1227404@nathanxps13> <0a0f4d52-ab75-4d69-abe8-5713bf70eee6@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jul 16, 2024 at 10:23:08PM -0500, Nathan Bossart wrote: > On Wed, Jul 17, 2024 at 11:30:04AM +0900, Michael Paquier wrote: >> Yeah, I have bumped on the same issue. In the long term, I also think >> that we'd better have pg_sequence_last_value() return a row with >> is_called and the value scanned. As you say, it won't help except >> when upgrading from versions of Postgres that are at least to v18, >> assuming that this change gets in the tree, but that would be much >> better in the long term and time flies fast. > > AFAICT pg_sequence_last_value() is basically an undocumented internal > function only really intended for use by the pg_sequences system view, so > changing the function like this for v18 might not be out of the question. > Otherwise, I think we'd have to create a strikingly similar function with > slightly different behavior, which would be a bizarre place to end up. On second thought, I worry that this change might needlessly complicate the pg_sequences system view. Maybe we should just add a pg_sequence_get_tuple() function that returns everything in FormData_pg_sequence_data for a given sequence OID... -- nathan