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 1tq6uS-00HAry-2t for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 08:48:52 +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 1tq6uQ-003idk-RN for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 08:48:50 +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 1tq6uQ-003iLK-CL for pgsql-hackers@lists.postgresql.org; Thu, 06 Mar 2025 08:48:50 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tq6uK-001GSq-0C for pgsql-hackers@lists.postgresql.org; Thu, 06 Mar 2025 08:48:47 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-223fb0f619dso6287365ad.1 for ; Thu, 06 Mar 2025 00:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1741250923; x=1741855723; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=/Nt3SDcrBhH7aU92LBvO8iUdyuL3uHnHW4ke+TRWhNo=; b=hT6gVVfMGn0enIwK2ZvvFUP/4uFGxZ2MPXfqwEzPyyNfYjT6kKqHH9RVHF/IUWNxpG 32gYlfvkpC1QA21m9WRqhcHkXPBBPp72TDjxTMYmn0ahITVOPJRjsGVqPCOdjwg8Ru3U UvJymnrXHbscKGoo1VszpbV3yDmZNYcXbOXE5VxHBtf7XO525Xchw6H2GN0ew3ruxhhV xvTK6c+8SQHFyqD0CWEwMgWDzxN0JS4I9keztE0fTpW5BzMc6F6ITd4AYAQmI0Jmveu9 XJBm/K/LBhBGR7FbhfwR5XYwcCpsE4VTZ2UfNpk6hrwqRhGhafIFl+r6ITd1p30N4aon k1vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741250923; x=1741855723; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/Nt3SDcrBhH7aU92LBvO8iUdyuL3uHnHW4ke+TRWhNo=; b=thduVvsT8asZDe8DzAlars+xFwHtakW2UYxL3LcvA11yNDvzqGyu+DIE/bGjsUlMRH gCsEuwcci/FrrFFylJHsfvoDJDgs75MgqbvyuqUHTPl8cvPtHxR4+wCKm/D6eGK+pnct /2iWULidqQBO5UWaCT07nKfsnoGrf8ydN90qqV2AE3OQeFGuHA/eZLxTaYRllQ+xwHvb ohyvGmaFIhoe7B5IWrOiP8bNtS/aQ67q1egZ7Wvtzn/m1jC3IrPEl6AINMF+Sn46o++7 nTRsek1/NkhVkb6boObnOOQUdNTYYdP+uRId7Em4roie3t5LqPu89JjBGzV1wJdaSxRF qyiQ== X-Forwarded-Encrypted: i=1; AJvYcCVTyGrY8lqXA8uhYAN8X6pNznevrQBbhAMiaI24UXShL5lprzGnu8ghM0UyI/85KOLlTIozmY/+wdqed3d/@lists.postgresql.org X-Gm-Message-State: AOJu0YzSDZ2xdVSbeST3VTENg1mMuiPDQGZCnciqV/ihgraktqkOOZRZ 0L0LGKFToXIPLGPeDtpLKhsdt3s/RLC00lvLlI91ZeF/A86jWVwoFfau2Zfixg== X-Gm-Gg: ASbGncvxK+6nnD4o3qTYf/N1Ue1P2UVmMe43bZFxLoJ4MeI8vqtZW4si8uphV+C5Lqb BOabjDGGsqsDZsa4h5yH5yF0ufyI8O6hAoBRgvq8lKODf99kPCDQeRMA4P81PMLNOqLK8t99Eqk ChBT8DTtqzKAd+RfWlZ5r6xLa7nqSBIZ2XFQFmYmxjRrFqJkCzwTnFEWMxi8jkHldeRNtjjQHJo E8pjtPu9TbqskL4r3Zb6Kqdx+U5CdcVpgYpM7GTUgrFdLy42OM3kjrwwM8S4KtKRbUnjQ8dJFGB vavm+opprU8zsA30mFWFTvqHKVo5yqKcpqfZgpJkCE1V9Dos3wAwa7kLkxsZsdZfLxL/ivXqcG4 pnwz0SpV5UPo= X-Google-Smtp-Source: AGHT+IHuG5TEebNkgTwcmwvzeLfcZn8y3PBNLNj+kfKEyxqHxGcsJMNVvcxGbAksWhwDod9ft/D/Kg== X-Received: by 2002:a05:6a00:2d1d:b0:736:61c9:f9a6 with SMTP id d2e1a72fcca58-73682b6c31fmr8577130b3a.5.1741250922680; Thu, 06 Mar 2025 00:48:42 -0800 (PST) Received: from jeff-laptop.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73698206b5csm800291b3a.26.2025.03.06.00.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 00:48:42 -0800 (PST) Message-ID: <31307315e23c281bdb7d9a8960dd58507b40a530.camel@j-davis.com> Subject: Re: Statistics Import and Export From: Jeff Davis To: Corey Huinker , Andres Freund Cc: Nathan Bossart , 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 Date: Thu, 06 Mar 2025 00:48:40 -0800 In-Reply-To: References: <6af48508a32499a8be3398cafffd29fb6188c44b.camel@j-davis.com> <6rpmhyrtci4epuzay7y5xvd2cwdwb6zmtt6ofxrvakyawxhm7s@6grajbpr4kij> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2025-03-05 at 23:04 -0500, Corey Huinker wrote: >=20 > Anyway, here's a rebased set of the existing up-for-consideration > patches, plus the optimization of avoiding querying on non-expression > indexes. Comments on 0003: * All the argument names for pg_restore_attribute_stats match pg_stats, except relname vs tablename. There doesn't appear to be a great answer here, because "relname" is the natural name to use for pg_restore_relation_stats(), so either the two restore functions will be inconsistent, or the argument name of one of them will be inconsistent with its respective catalog. I assume that's the reasoning? * it decides to only issue a WARNING, rather than an ERROR, if the table can't be found, which seems fine * Now that it's doing a namespace lookup, we should also check for the USAGE privilege on the namespace, right? Based on the other changes we've made to this feature, I think 0003 makes sense, so I'm inclined to move ahead with it, but I'm open to opinions. 0004 looks straightforward, though perhaps we should move some of the code into a static function rather than indenting so many lines. Did you collect performance results for 0004? Regards, Jeff Davis