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.98.2) (envelope-from ) id 1x9K6M-00000001vfM-3K8i for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Sep 2026 10:21:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x9K6L-00000004VlR-3TTJ for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Sep 2026 10:21:21 +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.98.2) (envelope-from ) id 1x9K6L-00000004VlI-2FZA for pgsql-hackers@lists.postgresql.org; Wed, 23 Sep 2026 10:21:21 +0000 Received: from mail-dy2-x10.google.com ([2607:f8b0:4864:36::10]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x9K6I-00000000rAh-3fjx for pgsql-hackers@lists.postgresql.org; Wed, 23 Sep 2026 10:21:20 +0000 Received: by mail-dy2-x10.google.com with SMTP id 5a478bee46e88-3286624d194so531680eec.3 for ; Wed, 23 Sep 2026 03:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790158877; cv=none; d=google.com; s=arc-20260327; b=jkufUwRDgv3XZMV/TY11g7jf3tuESqc0lA5ivvHjfbulK0s0BM72PUeyqziIX2mSS7 KROwgkSzCPeaXsbg9+mH4KEdGabREvTCC9H06txieY3ShOXgc/8lbqprd60rnkKil6lt 0XYuwgOWcXAxfWYc0wS3i5ou5NC7eqoU60jQd/KHnXvldneiUVwx3CU61ERneJssM8JW FwztGCKeQ1Mo7IrLOzeRXfH1jVJGC4xvsFjFnpNA7O+SK6il2lwmSJtvYr6aHbBbHwSu ET6KR7FE4GCMo9/m8RKteoFTyaRw6cAjxF3FKF+jJX/SDNnZccporPzA073A9OTlB4vb NDQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Ulwxiv9jV43QZDCD9lU1OO7XPSOCMAAV8w0t9GyfwR0=; fh=vnQAlusvHHl6uXcqKh5hhzIrA1TV7ShscQvu+OXiKQw=; b=NWWTWbHi7oS58mJkx/MNcCdDImmVBWVmhycd/2DnrvJsxwlqo7IFttYHvG1shBvROQ TA12r0wL6sEFAwJHOcV9vU0Vvu9/QQwSk6/VGjKCMASgRc/KREhfi5VVCOuek7Yniq8d JRHTMvO2Uky4b/6+5TARpFClp1kubfCkibQWlTDdA2pK3GZDV0TIfcHqF/MR1rqogq2Y et/pTHGQuxxck8t/0r8hnoNa/O/zVaKCbCZAWB8hc0/bJBJB/q+5VL94/t//JCIqmifr TGPBiZE6xZhSyv8BGNsjZJ4eYjMRGbc8o/khgBXTAzAhBV3UePy08NEOIyx75bB+TaBf nk9Q==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790158877; x=1790763677; darn=lists.postgresql.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Ulwxiv9jV43QZDCD9lU1OO7XPSOCMAAV8w0t9GyfwR0=; b=liEhcxtoEyhViNZOKeGXnecCVNM38mdhUCuCnSez1YK/myYzAunjB5PHoJO7xMocJk TOqhlqC5HLo6S6uIgbq/BFW57OILAZ1QTRruQnhltI4M6NhaLF2/S6hNHaxMjV4jNYgd WDp8dDRjyFdd1ca40gLZeYbE+707RMBNSeFiNZXRlZwj8VaodkV6CJ3Ag/fsud6tMqTv GeqYPVGCRFVjjRuBZMLatyu9SFrFuPphV1RYLCTH7YDZjmVKSuT864kl3GZBSmUkz1vg 3NCJtivgfUW7NWq3T2Sef1Gxm0jxG6az/5plDjjXdvnQ4IphBQnxKNuj1fuYrY3Stb2u xfPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790158877; x=1790763677; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Ulwxiv9jV43QZDCD9lU1OO7XPSOCMAAV8w0t9GyfwR0=; b=m+XcWYfeGW+lswiZt3kUHhFVxxLn5vwoGeza4bXrsWHusqfgYHQxibHFnzUEwrbbsS QQMc/HJyNUJakMbi5le5VtewzOisItj6QstoVppjmW9XU23hRo6Ud37qjGrUIZJfUTd+ jHMLp8/okl4vbY+p04wMvsDEEq82uRXqAuhXNs2S5lpBOkUvbpbwGEPD1M/LHfPvNwzc rUB06afRBQ5zcAYzPQf1LoRfIZB6UX3unLHwsTK8N/mN3/y9SdQ/iFnqNjTMrBcsBei0 gydhgcItB389gCYkRd/bKpMNFiIqVXWggByBQ3mibSNxNfH1YZyVPjemL+/8jXeyrbBU E/lA== X-Forwarded-Encrypted: i=1; AKwUvBxk2Hv9uc761b/qLV3sA9FvXH+YsvR2tKmAD2B4yJwWpi3LI/xWXkBcYtMZ5ipLk+JkLGOW7nfKYjl/oEWZ@lists.postgresql.org X-Gm-Message-State: AFuF++muIvUvqt0+fOYFqpExJyGc1+GM1obN0jfSh7/9SV43cYkcb0ki 6aas+5Dctz8US4R6NsOW9Zsc2VMFquVdg/8RU3rblFHM/IPpQLP71fTTSP4MZj2JeWL/UEhwFcz fDXOVRuoiXOp1WiX9PkQvZiJ6sn8qWM4= X-Gm-Gg: AYBFou2tYhnVEw83rUHBvcVK9RDRahIOA0ckRmJKCd1f4evjk1IDC9h6YP2SrHHGJN/ AbeLQ4vZDnjFwvvKD9ieucapY29Hcd9Cmhnnmexmsie/A2RPKEHWxzrI3wlhvCB5CFlCr+1ajIg 7SxFoN7HLEjKfzTqrJtJMBM22NnpYkb418NMmXnFBxpMSmFc89OO+FaYtSOQr/CyLkBc/gDPDTZ E/CMFu5rB6+dKiNp7dwRVu2N3rNgtxjMXU2OTK2mZSbjsWkzuDYYyTq5ZodmBFIJ2dqNnaDxVxX LdYMzZObNpu+GmOeWwp7luNQJXiRbB1ZidR1S/EmHj4XXzCNyknJDPx3kuZWwP9pd8yUnUJ9mTV uQ2J9HjDKt2Fxhcep5C4UXaNsyozlL5JT6Wja9hUMZdsjHGAMN2jL3cl+fz+7EyMOcPfiLEaIyi AR/4bE3HfjeWyNuCOibOskGiObu64roD2oVQ== X-Received: by 2002:a05:7301:2f2f:b0:33e:4475:5e02 with SMTP id 5a478bee46e88-33e8c0591b5mr2159863eec.5.1790158876679; Wed, 23 Sep 2026 03:21:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Etsuro Fujita Date: Wed, 23 Sep 2026 19:21:03 +0900 X-Gm-Features: AclHuK8Zu3wnSAZcpRhZBefZ9VgYpt_4X24iIoFkp04e0dvqsBXexu-x_lfS_hM Message-ID: Subject: Re: [PG19][PATCH] Make postgres_fdw statistics import atomic To: Corey Huinker Cc: Andres Freund , Nikolay Samokhvalov , pgsql-hackers , ashutosh.bapat.oss@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Sep 19, 2026 at 7:55=E2=80=AFPM Etsuro Fujita wrote: > > 2. Consider whether do_analyze_rel should do something (like clear the = pg_statistic rows for the relation) in the case where numrows returned from= the acquirefunc is zero. > > I also thought this option; it would make things logically clean, but > I'm not sure we really need to do so, because in that case we set > reltuples=3D0 in pg_class, which makes the planner effectively ignore > the remaining attribute stats. See set_baserel_size_estimates(); if > reltuples=3D0, we have rel->tuples=3D0, so whatever value > clauselist_selectivity() calculates/returns based on the attribute > stats, rel->rows (the estimated number of output tuples from the base > relation) is set to zero. Correction: since clamp_row_est() forces a row-count estimate to be at least one row, we have rel->rows=3D1, not rel->rows=3D0. Sorry. Best regards, Etsuro Fujita