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 1uHr0m-00B5HL-E9 for pgsql-hackers@arkaria.postgresql.org; Wed, 21 May 2025 21:30:04 +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 1uHr0l-00Baiv-At for pgsql-hackers@arkaria.postgresql.org; Wed, 21 May 2025 21:30:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uHr0l-00Baim-0Y for pgsql-hackers@lists.postgresql.org; Wed, 21 May 2025 21:30:02 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uHr0i-000Cgc-18 for pgsql-hackers@lists.postgresql.org; Wed, 21 May 2025 21:30:02 +0000 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-3dc7294716cso24869365ab.2 for ; Wed, 21 May 2025 14:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747862998; x=1748467798; darn=lists.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=soGpyKpkYh9SRM/PAUFWyXEeERHPQYkRJhhm/5dQ5R4=; b=jwRQxGPPESy79LMFqEtfCo3R9wcrZf+lLMIRWH8EiUkmA+XVerXUB3OtWU6zk08jb0 8rzfq+ho19HeyHTAnfae02C3vpYpWCqmqfPSz2zvBd9+GId9uWTQrwMuSeXq3/is1VAB Lg0uq4wu8s+ThdcZ59YqdIzdNsZRMXGjM47pz/JibTWdZrOlIdIKBGpKbaaf2ywefgQU ZptGnjbRjj3TLjsw93Z8z8YYedGQbvOxpWHAOPMlvLifyK7lLIHt5i71u13y/HxVniAd wCFcliHDT2SGSpQXbvjJEl3hQ+TfNZZwBdztteToTVve/XjnCXWJlnlZxGxeDuPWTOU7 QppA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747862998; x=1748467798; 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=soGpyKpkYh9SRM/PAUFWyXEeERHPQYkRJhhm/5dQ5R4=; b=gvSmSnnbNmAfGQbi4KP0f6eUIc/wbM2UGNtnU8azFAT+X/XklyoOAxIIkbGiT64LnP eShvbxtqHtqtffrS6OXLkM4HwYjuNex41ZxUT+2iideFnoQZ3EydmAqGIuDXWdU/YH6s BDOznphoYENCtiU7MbMnbsk3cx6aBReucSObpFKkfRDP2SEH/QD+R+7ZjNA2GsB6sHDX qo5yljmHQgND3MOvR4pTuejS9hTOGy2rvXrWtU7CyY0iJPhiRno49zYRUEcOSbrrkyfB YS//QA0BTJGuN9TRxQSwq+kSIOwRONRapzJvrAonge4Hkzp2B0PBXawakDCdnRuBAgCj fISw== X-Forwarded-Encrypted: i=1; AJvYcCUQqHR/V3IdAFnJ1f8GANsgRywbifp4rOts+zkYdWpJHFEGiHMZHg+SS6S/+xqpBlC2C3rzFq1Nm7RFt+sj@lists.postgresql.org X-Gm-Message-State: AOJu0Yw4iJ1ylR494jtgTWbjj7qdtu5CmROcqWBT2rMT3EBFA9lj435Y tZ9h4RV/h3Jgbdc9NDGC4EMhhfUsPLxDVL/pn0ev1J9/v2R80GAaB6jC X-Gm-Gg: ASbGnctC1UqM6y1PNmkc8BYyg+UGfLGt9RxoryHohl4DaPc4TvzzL5noS+mHIw3grnV iBnPHFeulBXt9llllwUnDZ4aQs7toht2xq9ZKO5Dk3e7YeydC0qABJ5H2xELSjgfF3PXHO4fs4p +a4/LNI2s2ACKxTuyd2DVXJSMgAy4JMmvN+e8mMRMUWu251tlj+cQ/GYZIRdQx0C00V9KDXGSGN 8En8nzfXqdvBUbO+Baa+C3REQv4hlrv0W/hpu1vjcGNYRGXG9npHDJsNUlbJPqm1QCBGrAlD4t0 j1ROWsdEXFhSY6+3FkqAzhrRMS4zKkbVbdKYOnW6kBHh4LOfY1EH5KImut+Okx/bU/D1U3RNHf6 C0LYYbqDM4n0Pzd5YWWIJX8T/raCXh1YTbnxtD3uMgw== X-Google-Smtp-Source: AGHT+IGwLqCfVraOCS4qWZ6ruOMozAIBveKTTbbW+uF+NlVS1pSs9GVrylpBG0zv8rqDYTLz1wrWuQ== X-Received: by 2002:a05:6e02:3a01:b0:3d6:cbad:235c with SMTP id e9e14a558f8ab-3db8573b700mr220709305ab.6.1747862998536; Wed, 21 May 2025 14:29:58 -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-4fbd17aa848sm2667732173.67.2025.05.21.14.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 May 2025 14:29:58 -0700 (PDT) Date: Wed, 21 May 2025 16:29:56 -0500 From: Nathan Bossart To: Jeff Davis Cc: Hari Krishna Sunder , Corey Huinker , Robert Treat , Robert Haas , Andres Freund , Tom Lane , Michael Paquier , jian he , Bruce Momjian , Matthias van de Meent , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org Subject: Re: Statistics Import and Export Message-ID: References: <6886e8bffbccf14766ba66c08ca4bcc174c1c1d8.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6886e8bffbccf14766ba66c08ca4bcc174c1c1d8.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, May 21, 2025 at 02:14:55PM -0700, Jeff Davis wrote: > Originally, one of the reasons we added a version field during dump is > so that some future version could reinterpret stats in older dump files > during import. > > This patch is using a newer version of pg_dump to interpret stats from > older versions during export. That might be fine, but it would be good > to understand where the line is between things we should reinterpret > during export vs things we should reinterpret during import. I don't know precisely where that line might be, but in this case, the dumped stats have no hope of restoring into anything older than v18 (since the stats import functions won't exist), which is well past the point where we started using -1 for reltuples. If we could dump the stats from v13 and restore them into v13, then I think there would be a reasonably strong argument for dumping it as-is and reinterpreting as necessary during import. But I see no particular benefit from moving the complexity to the import side here. Does that seem like a reasonable position to you? Is there anything else we should consider? -- nathan