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 1u0Wf5-002dyr-Ga for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Apr 2025 02:20:03 +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 1u0Wf2-00CJx9-Cr for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Apr 2025 02:20:00 +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 1u0Wf1-00CJx0-Ov for pgsql-hackers@lists.postgresql.org; Fri, 04 Apr 2025 02:20:00 +0000 Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u0Wey-002q2g-1w for pgsql-hackers@lists.postgresql.org; Fri, 04 Apr 2025 02:19:58 +0000 Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-6f74b78df93so19853647b3.0 for ; Thu, 03 Apr 2025 19:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743733196; x=1744337996; 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=ODDMRTSKmTtR+htH+RW8rioK+ZnU8zUAYKiD425TGfI=; b=J24oSyHf6teQAdAfMMw0JhA8cAfn05oVYXTAyUWTmXUVXtbwcTwcrje1BL6J9AwNpu t3klI/tKIBrFVa756wlHvML69JUQcew/oXDfhiL4cuX/UPvC04FNPqvlnkOv/dq/s9sN qv8fzplXwF6jSnwaQH5GT3dewPl9qF7/ZO3f25GBTyJJBw2pHjqv6KmD/F/Yz3c+3RDp 7qe60sNXhDPCbrM3ysffCb+DAC22AQlHKdDVxlMVC9UUurslc0yZgfH8M315Hd8Q6s2w QcRM+L1tXcQc+e9z4qTvpr1RvXVWma2ob5zzeZmH2aWI6U5vCaSWDiqStihNY5ayAfTz 8z/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743733196; x=1744337996; 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=ODDMRTSKmTtR+htH+RW8rioK+ZnU8zUAYKiD425TGfI=; b=cwDyy/in0gsOFQLcDz+uIu9Snj8jXCa9q8ZRf0BNQf+SKOgWsFxVVA8SKtWrLCsw3g /DWbENQpwn4lELKCEiaBNJa6Ru6sj0WjL71v3L6NxD4LDbyA4+OjU3ki+AF+cr0MNCob U8ei1OuMCmocYcgVuVsF9RjGY3BOYYLnChs5nCMa6ppzRY4iltDw1KzQIUwaxSQllxcq /99HAf/w8uFySAOC897bezHADUH68+PDhouH3N1yCoa4AoNFqAUZaCUNQnC5/lgjusDi N9YhZJouLz9S1lmMv6EvCef9/Q88Thj2P1fYSM4RY92OKGTQ8zvq2taYyfEVDvSf2WaB Mc1w== X-Forwarded-Encrypted: i=1; AJvYcCUEk7qfQEZxMyXOWcEo8te0rkfsEDYYRdRaX2p8GnSaCRDn1ke21owZqrBLQ2j7DA9eo0Xz2atP49sV6f79@lists.postgresql.org X-Gm-Message-State: AOJu0Yxl8jeRjygHTLlxtpTgLTeGXFIQd3OxGkf5zp9pVyy2m4WYCy1p lF6koRR2TohPa7yP47e7Pzkxek17gQ4mFH2W9SLjlSm8eqnVEDOr X-Gm-Gg: ASbGncsNz/u/eb0BEuCAr5BM4v7hm4QNFjcotBrqmsWtYnaM0F4xuiUxcUhYmgMbbK9 As/vADE5Zdlwz1hdiM6E6CAzHSuUpxplyg5XFMc1Ff+1izUIW72TCNUDRbO5n7bOS2k7prPEPim Xq6JMtzyaCBpuR/NUydxHg8gjnRhkbVfqLNEZd0v7+eZaJoY+JZDCCIYeoEnqrTHr3jKfL3+dTO M4HOtw1M0BwhxRx/3S/rUxSRZiqtYuQn9OQErGcio3TdBN9VdcraPEWuTxhtoNFuIuP3kTmlFea 7zhBGWkDPKf+mTMNlEOU4U/nEOPVR32epm98DRF270iiYK8uyXhznLalIhikdJrZfarX3ypZvcd MARtqTjmY8VCwBx55hU1iWVkbeNSCCBAnjss= X-Google-Smtp-Source: AGHT+IFAuDcBLproIKgm51b/pC464h4O6/GLPgoC3mqcvcnvUzuPnbFTH/4GWCNOs0VBAIeajZkOyQ== X-Received: by 2002:a05:690c:7404:b0:703:c3ba:a490 with SMTP id 00721157ae682-703e3108a6cmr22054167b3.2.1743733195417; Thu, 03 Apr 2025 19:19:55 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 00721157ae682-703d1fe07b5sm6604837b3.122.2025.04.03.19.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Apr 2025 19:19:54 -0700 (PDT) Date: Thu, 3 Apr 2025 21:19:51 -0500 From: Nathan Bossart To: Jeff Davis Cc: 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: <88af35fe0ff24cc4e0700b841aa60a0865f11648.camel@j-davis.com> <8a6905c658ed52418c6f413393390dc43d63a995.camel@j-davis.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="KIyZLC1cNgqfVArR" Content-Disposition: inline In-Reply-To: <8a6905c658ed52418c6f413393390dc43d63a995.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --KIyZLC1cNgqfVArR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Thanks for reviewing. On Thu, Apr 03, 2025 at 03:23:40PM -0700, Jeff Davis wrote: > This simplifies commit a0a4601765. I'd break out that simplification as > a separate commit to make it easier to understand what happened. Done. > In patch 0003, there are quite a few static function-scoped variables, > which is not a style that I'm used to. One idea is to bundle them into > a struct representing the cache state (including enough information to > fetch the next batch), and have a single static variable that points to > that. As discussed off-list, I didn't take this suggestion for now. Corey did this originally, and I converted it to static function-scoped variables 1) to reduce patch size and 2) because I noticed that each of the state variables were only needed in one function. I agree that a struct might be slightly more readable, but we can always change this in the future if desired. > Also in 0003, the "next_te" variable is a bit confusing, because it's > actually the last TocEntry, until it's advanced to point to the current > one. I've renamed it to expected_te. > Other than that, looks good to me. Great. I'm planning to commit the attached patch set tomorrow morning. For the record, I spent most of today trying very hard to fix the layering violations in 0002. While I was successful, the result was awkward, complicated, and nigh unreadable. This is now the second time I've attempted to fix this and have felt the result was worse than where I started. So, I added extremely descriptive comments instead. I'm hoping that it will be possible to clean this up with some additional work in v19. I have a few ideas, but if anyone has suggestions, I'm all ears. -- nathan --KIyZLC1cNgqfVArR Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v12n6-0001-Skip-second-WriteToc-call-for-custom-format-du.patch"