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.96) (envelope-from ) id 1wgkgA-006NFr-1f for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2026 14:52:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wgkg9-001J51-1A for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2026 14:52:13 +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.96) (envelope-from ) id 1wgkg8-001J4m-2i for pgsql-hackers@lists.postgresql.org; Mon, 06 Jul 2026 14:52:13 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wgkg6-00000001rWY-1Kv6 for pgsql-hackers@lists.postgresql.org; Mon, 06 Jul 2026 14:52:11 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-385b78b44a0so1271886a91.0 for ; Mon, 06 Jul 2026 07:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783349529; x=1783954329; darn=lists.postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=AA+JOWYj9h2/KdtjUEAJNIsIhqn6mBENsFh+odZJzEQ=; b=jipKdmHCT2UNEPaYp6RLjADz1EaxpdA1v5Kqh6N1S+krGZU9QtO0EJtynfdkMb6kby 3zYsgwU73YlJZDN129UOXqrn8WknVolJs2yU3oSH5yZXNZxX6V9kJTMh3k4WrPtxTsyy Z3/i+GZ16cuP3OSjwwV5VoNXd6oKiszHHs2pU5To715zJobOMMvviXNM81Nca43kZU1J yMtpQidSZ6nARKtynGHHON9h/Z1pP/W+6F8i32P9VXOEWcejWU/t4gfHDKdWoP9RL5zA azZzdvpOW/qgcDU8urNqHI0TQCGdmZgzXAH6l408vq2aT8WK1C/1uGzO2Rf8qynxcPuE nxKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783349529; x=1783954329; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AA+JOWYj9h2/KdtjUEAJNIsIhqn6mBENsFh+odZJzEQ=; b=Z4iTOpzIPvLmUdsgxtmtjUwFTY6IIearc1oYw0M3y7lFcSmJNcWOhjxwa+Pleg6YDK QHTOZTZqV/KU0Q6rrBvVsEjMxB7OHl5AL126r7ZpBI73LFDCB3kMjC3u+56Ijjd8Qof/ 3s3ZXz7ViMpVsosij0TEUgSuEB2D+rueGLlyKPes/n7Kfegv5Gc0hQN+AtWUng6qnn0s tsLj3d2M55kL/aa1mnsn5xIJIHGnway1+odVsKFMZHSfkBEBw2Z7wm1bnZ7uBuxBd/EY 2ync2AGbDDr3yXCZg7q0cVLgOD9xdXrSF9w/lABFTgg0Qes2a2awxxOhvg8t0EvaDvn4 UgiQ== X-Gm-Message-State: AOJu0YzZak2O0XyoooCtY9po667NoWSirjFJBUPL1lKEF+TsRQweok21 vuOWlb03OnP3cy7KNo0wlYEf7nZ6KrRKnFjrGS3W9KwaxBk88jsv38rd X-Gm-Gg: AfdE7ckcrNF5/2mOo9Uhikv/mkhC9jiWwP7tfnlKqncQrmY+SAbB7i6uPr91uQmi6fB mVDZZxqB7+xwW7zXX4Ue+UFdi16jCpLTofE0NSOyf+6cHs9r3HExFP6sc/jqjHUHvSB9moWt1/V KsuY08BvY86lIZrFOxijY4qeVNRN2WuTTeLF4ymBbzWyipkk/x2YNhUpVyHZ9Mvh6bak5AJaoYW iHj2Sj1eSBcfiJdNvdxPsRQlOxbRDyWo4eEnyCakJ4MVZkJXaGFWLDMQ1OSr2ywwi+nKhB4QKU1 r33Rk6BBBgQIG+in/kkpoM143ceIBhLwvrrleze7YWXmnQZb+/s/slfMd0gs0nHFI5yMK3Dhog3 V5A8qN8CGW0Cm7IT8me+0jybfDU31DTINzsTFc8d7ETY7/Ysy1vylwS9PB4K+jNZxek5cM5bm9j yHscPQKP0n59R2jYwyXYrsmG57lrcgRVOXJjU+hQnDGuinEnQ= X-Received: by 2002:a17:90b:1845:b0:37f:9cdf:f0ad with SMTP id 98e67ed59e1d1-38757d76999mr786092a91.28.1783349529362; Mon, 06 Jul 2026 07:52:09 -0700 (PDT) Received: from smtpclient.apple ([2601:642:4c02:8226:f5a9:67df:670c:8897]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3113c88041fsm23398265eec.15.2026.07.06.07.52.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2026 07:52:07 -0700 (PDT) From: Chao Li Message-Id: <65F7302E-EFE3-4BF6-AA7F-9A41C82F6FBF@gmail.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_17610643-A31A-4241-80B0-ACD76746931E" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: postgres_fdw: fix cumulative stats after imported foreign-table stats Date: Mon, 6 Jul 2026 07:51:36 -0700 In-Reply-To: Cc: PostgreSQL Hackers , Corey Huinker To: Etsuro Fujita References: <6ED81190-B398-44C9-A1E9-8EFE4ED183AF@gmail.com> <9FFB81DF-3F7F-42B5-915D-904F22B508C1@gmail.com> X-Mailer: Apple Mail (2.3864.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_17610643-A31A-4241-80B0-ACD76746931E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 5, 2026, at 21:36, Etsuro Fujita = wrote: >=20 > Hi Chao, >=20 > On Sat, Jul 4, 2026 at 10:24=E2=80=AFPM Chao Li = wrote: >> I thought postgres_fdw was where we interact with the remote server, = while analyze_rel() is the code deciding that ANALYZE succeeded. = Ideally, cumulative ANALYZE reporting would be driven from that level, = not from an FDW callback implementation. >=20 > The division of labor would be arbitrary: as mentioned upthread, the > FDW callback is designed as a function corresponding to > do_analyze_rel(), which not only updates the stats system catalogs but > reports to pgstats, so I think it's appropriate for the callback to do > the report as well. >=20 >> But I understand your concern about changing the = ImportForeignStatistics API, so I=E2=80=99m fine with your proposal. I = have integrated your changes into v2. >=20 > Ok, thanks for the integration! >=20 > @@ -230,7 +230,8 @@ analyze_rel(Oid relid, RangeVar *relation, > if (fdwroutine->ImportForeignStatistics !=3D NULL && > fdwroutine->ImportForeignStatistics(onerel, va_cols, = elevel)) > stats_imported =3D true; > - else > + > + if (!stats_imported) >=20 > Is this a leftover? >=20 Ah, yes, that=E2=80=99s a leftover. Reverted that in v3. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/ --Apple-Mail=_17610643-A31A-4241-80B0-ACD76746931E Content-Disposition: attachment; filename=v3-0001-Fix-ANALYZE-reporting-after-imported-foreign-tabl.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v3-0001-Fix-ANALYZE-reporting-after-imported-foreign-tabl.patch" Content-Transfer-Encoding: quoted-printable =46rom=20283c4acbe68520153f9c91b4d2fc19dea5ae3267=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20"Chao=20Li=20(Evan)"=20=0A= Date:=20Fri,=2012=20Jun=202026=2011:20:19=20+0800=0ASubject:=20[PATCH=20= v3]=20Fix=20ANALYZE=20reporting=20after=20imported=20foreign-table=20= stats=0A=0ACommit=2028972b6fc=20added=20the=20ImportForeignStatistics=20= FDW=20callback,=20which=0Alets=20ANALYZE=20import=20remote=20statistics=20= instead=20of=20sampling=20a=20foreign=20table.=0AWhen=20that=20path=20= succeeds,=20analyze_rel()=20skips=20do_analyze_rel().=20That=20also=0A= skips=20pgstat_report_analyze(),=20so=20cumulative=20ANALYZE=20stats=20= such=20as=0Aanalyze_count,=20last_analyze_time,=20and=20live_tuples=20= are=20not=20updated=20even=0Athough=20ANALYZE=20succeeded.=0A=0AFix=20by=20= having=20postgres_fdw=20report=20ANALYZE=20to=20the=20cumulative=20stats=20= system=0Aafter=20a=20successful=20statistics=20import.=20The=20imported=20= live-row=20estimate=20comes=0Afrom=20the=20remote=20reltuples=20value.=20= Since=20imported=20relation=20stats=20do=20not=0Ainclude=20a=20= dead-tuple=20estimate,=20report=20zero=20dead=20tuples=20for=20this=20= path.=0A=0AAdd=20regression=20coverage=20for=20postgres_fdw=20stats=20= import=20to=20verify=20that=20a=0Asuccessful=20imported=20ANALYZE=20= updates=20live_tuples=20and=20analyze_count.=0A=0AAuthor:=20Chao=20Li=20= =0AReported-by:=20Chao=20Li=20=0A= Reviewed-by:=20Etsuro=20Fujita=20=0ADiscussion:=20= https://postgr.es/m/6ED81190-B398-44C9-A1E9-8EFE4ED183AF@gmail.com=0A---=0A= =20.../postgres_fdw/expected/postgres_fdw.out=20=20=20=20|=2040=20= +++++++++++++++++++=0A=20contrib/postgres_fdw/postgres_fdw.c=20=20=20=20=20= =20=20=20=20=20=20|=2017=20++++++++=0A=20= contrib/postgres_fdw/sql/postgres_fdw.sql=20=20=20=20=20|=2010=20+++++=0A= =203=20files=20changed,=2067=20insertions(+)=0A=0Adiff=20--git=20= a/contrib/postgres_fdw/expected/postgres_fdw.out=20= b/contrib/postgres_fdw/expected/postgres_fdw.out=0Aindex=20= 0805c56cb1b..5ebae1cedc2=20100644=0A---=20= a/contrib/postgres_fdw/expected/postgres_fdw.out=0A+++=20= b/contrib/postgres_fdw/expected/postgres_fdw.out=0A@@=20-12973,9=20= +12973,29=20@@=20ALTER=20FOREIGN=20TABLE=20simport_ftable=20OPTIONS=20= (ADD=20restore_stats=20'true');=0A=20ANALYZE=20simport_ftable;=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20should=20fail=0A=20= WARNING:=20=20could=20not=20import=20statistics=20for=20foreign=20table=20= "public.simport_ftable"=20---=20remote=20table=20"public.simport_table"=20= has=20no=20relation=20statistics=20to=20import=0A=20ANALYZE=20= simport_table;=0A+SELECT=20= pg_stat_reset_single_table_counters('public.simport_ftable'::regclass);=0A= +=20pg_stat_reset_single_table_counters=20=0A= +-------------------------------------=0A+=20=0A+(1=20row)=0A+=0A=20= ANALYZE=20VERBOSE=20simport_ftable;=20=20=20=20=20=20=20=20=20=20=20--=20= should=20work=0A=20INFO:=20=20importing=20statistics=20for=20foreign=20= table=20"public.simport_ftable"=0A=20INFO:=20=20finished=20importing=20= statistics=20for=20foreign=20table=20"public.simport_ftable"=0A+SELECT=20= pg_stat_force_next_flush();=0A+=20pg_stat_force_next_flush=20=0A= +--------------------------=0A+=20=0A+(1=20row)=0A+=0A+SELECT=20= pg_stat_get_live_tuples('public.simport_ftable'::regclass),=0A+=20=20=20=20= =20=20=20pg_stat_get_dead_tuples('public.simport_ftable'::regclass),=0A+=20= =20=20=20=20=20=20= pg_stat_get_analyze_count('public.simport_ftable'::regclass);=0A+=20= pg_stat_get_live_tuples=20|=20pg_stat_get_dead_tuples=20|=20= pg_stat_get_analyze_count=20=0A= +-------------------------+-------------------------+---------------------= ------=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=200=20|=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=200=20|=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=201=0A+(1=20row)=0A+=0A=20ALTER=20TABLE=20simport_table=20= ALTER=20COLUMN=20c1=20SET=20STATISTICS=200;=0A=20ALTER=20TABLE=20= simport_table=20ALTER=20COLUMN=20c2=20SET=20STATISTICS=200;=0A=20INSERT=20= INTO=20simport_table=20VALUES=20(1,=20'foo'),=20(1,=20'foo'),=20(2,=20= 'bar'),=20(2,=20'bar');=0A@@=20-12988,9=20+13008,29=20@@=20ANALYZE=20= simport_ftable;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= --=20should=20fail=0A=20WARNING:=20=20could=20not=20import=20statistics=20= for=20foreign=20table=20"public.simport_ftable"=20---=20no=20attribute=20= statistics=20found=20for=20column=20"c2"=20of=20remote=20table=20= "public.simport_table"=0A=20ALTER=20TABLE=20simport_table=20ALTER=20= COLUMN=20c2=20SET=20STATISTICS=20DEFAULT;=0A=20ANALYZE=20simport_table;=0A= +SELECT=20= pg_stat_reset_single_table_counters('public.simport_ftable'::regclass);=0A= +=20pg_stat_reset_single_table_counters=20=0A= +-------------------------------------=0A+=20=0A+(1=20row)=0A+=0A=20= ANALYZE=20VERBOSE=20simport_ftable;=20=20=20=20=20=20=20=20=20=20=20--=20= should=20work=0A=20INFO:=20=20importing=20statistics=20for=20foreign=20= table=20"public.simport_ftable"=0A=20INFO:=20=20finished=20importing=20= statistics=20for=20foreign=20table=20"public.simport_ftable"=0A+SELECT=20= pg_stat_force_next_flush();=0A+=20pg_stat_force_next_flush=20=0A= +--------------------------=0A+=20=0A+(1=20row)=0A+=0A+SELECT=20= pg_stat_get_live_tuples('public.simport_ftable'::regclass),=0A+=20=20=20=20= =20=20=20pg_stat_get_dead_tuples('public.simport_ftable'::regclass),=0A+=20= =20=20=20=20=20=20= pg_stat_get_analyze_count('public.simport_ftable'::regclass);=0A+=20= pg_stat_get_live_tuples=20|=20pg_stat_get_dead_tuples=20|=20= pg_stat_get_analyze_count=20=0A= +-------------------------+-------------------------+---------------------= ------=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=204=20|=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=200=20|=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=201=0A+(1=20row)=0A+=0A=20ANALYZE=20VERBOSE=20simport_ftable=20= (c1);=20=20=20=20=20=20--=20should=20work=0A=20INFO:=20=20importing=20= statistics=20for=20foreign=20table=20"public.simport_ftable"=0A=20INFO:=20= =20finished=20importing=20statistics=20for=20foreign=20table=20= "public.simport_ftable"=0Adiff=20--git=20= a/contrib/postgres_fdw/postgres_fdw.c=20= b/contrib/postgres_fdw/postgres_fdw.c=0Aindex=206fa45773c30..e5917eb7449=20= 100644=0A---=20a/contrib/postgres_fdw/postgres_fdw.c=0A+++=20= b/contrib/postgres_fdw/postgres_fdw.c=0A@@=20-41,6=20+41,7=20@@=0A=20= #include=20"optimizer/restrictinfo.h"=0A=20#include=20= "optimizer/tlist.h"=0A=20#include=20"parser/parsetree.h"=0A+#include=20= "pgstat.h"=0A=20#include=20"postgres_fdw.h"=0A=20#include=20= "statistics/statistics.h"=0A=20#include=20"storage/latch.h"=0A@@=20-52,6=20= +53,7=20@@=0A=20#include=20"utils/rel.h"=0A=20#include=20= "utils/sampling.h"=0A=20#include=20"utils/selfuncs.h"=0A+#include=20= "utils/timestamp.h"=0A=20=0A=20PG_MODULE_MAGIC_EXT(=0A=20=09=09=09=09=09= .name=20=3D=20"postgres_fdw",=0A@@=20-336,6=20+338,8=20@@=20typedef=20= struct=0A=20=09PGresult=20=20=20*rel;=0A=20=09PGresult=20=20=20*att;=0A=20= =09int=09=09=09server_version_num;=0A+=09double=09=09livetuples;=0A+=09= double=09=09deadtuples;=0A=20}=20RemoteStatsResults;=0A=20=0A=20/*=20= Column=20order=20in=20relation=20stats=20query=20*/=0A@@=20-5597,6=20= +5601,7=20@@=20postgresImportForeignStatistics(Relation=20relation,=20= List=20*va_cols,=20int=20elevel)=0A=20=09RemoteStatsResults=20remstats=20= =3D=20{.rel=20=3D=20NULL,=20.att=20=3D=20NULL};=0A=20=09= RemoteAttributeMapping=20*remattrmap=20=3D=20NULL;=0A=20=09int=09=09=09= attrcnt=20=3D=200;=0A+=09TimestampTz=20starttime=20=3D=200;=0A=20=09bool=09= =09restore_stats=20=3D=20false;=0A=20=09bool=09=09ok=20=3D=20false;=0A=20= =09ListCell=20=20=20*lc;=0A@@=20-5656,6=20+5661,8=20@@=20= postgresImportForeignStatistics(Relation=20relation,=20List=20*va_cols,=20= int=20elevel)=0A=20=09=09=09(errmsg("importing=20statistics=20for=20= foreign=20table=20\"%s.%s\"",=0A=20=09=09=09=09=09schemaname,=20= relname)));=0A=20=0A+=09starttime=20=3D=20GetCurrentTimestamp();=0A+=0A=20= =09ok=20=3D=20fetch_remote_statistics(relation,=20va_cols,=0A=20=09=09=09= =09=09=09=09=09=20table,=20schemaname,=20relname,=0A=20=09=09=09=09=09=09= =09=09=20&attrcnt,=20&remattrmap,=20&remstats);=0A@@=20-5665,9=20= +5672,15=20@@=20postgresImportForeignStatistics(Relation=20relation,=20= List=20*va_cols,=20int=20elevel)=0A=20=09=09=09=09=09=09=09=09=09=20=20=20= attrcnt,=20remattrmap,=20&remstats);=0A=20=0A=20=09if=20(ok)=0A+=09{=0A+=09= =09pgstat_report_analyze(relation,=0A+=09=09=09=09=09=09=09=20=20= remstats.livetuples,=20remstats.deadtuples,=0A+=09=09=09=09=09=09=09=20=20= (va_cols=20=3D=3D=20NIL),=20starttime);=0A+=0A=20=09=09ereport(elevel,=0A= =20=09=09=09=09(errmsg("finished=20importing=20statistics=20for=20= foreign=20table=20\"%s.%s\"",=0A=20=09=09=09=09=09=09schemaname,=20= relname)));=0A+=09}=0A=20=0A=20=09PQclear(remstats.rel);=0A=20=09= PQclear(remstats.att);=0A@@=20-5807,6=20+5820,10=20@@=20= fetch_remote_statistics(Relation=20relation,=0A=20=09=09}=0A=20=09}=0A=20= =0A+=09/*=20We=20assume=20that=20we=20have=20no=20dead=20tuple.=20*/=0A+=09= remstats->deadtuples=20=3D=200.0;=0A+=09remstats->livetuples=20=3D=20= reltuples;=0A+=0A=20=09ok=20=3D=20true;=0A=20=0A=20fetch_cleanup:=0Adiff=20= --git=20a/contrib/postgres_fdw/sql/postgres_fdw.sql=20= b/contrib/postgres_fdw/sql/postgres_fdw.sql=0Aindex=20= 8162c5496bf..e868da00ace=20100644=0A---=20= a/contrib/postgres_fdw/sql/postgres_fdw.sql=0A+++=20= b/contrib/postgres_fdw/sql/postgres_fdw.sql=0A@@=20-4587,7=20+4587,12=20= @@=20ANALYZE=20simport_ftable;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20--=20should=20fail=0A=20=0A=20ANALYZE=20simport_table;=0A=20=0A= +SELECT=20= pg_stat_reset_single_table_counters('public.simport_ftable'::regclass);=0A= =20ANALYZE=20VERBOSE=20simport_ftable;=20=20=20=20=20=20=20=20=20=20=20= --=20should=20work=0A+SELECT=20pg_stat_force_next_flush();=0A+SELECT=20= pg_stat_get_live_tuples('public.simport_ftable'::regclass),=0A+=20=20=20=20= =20=20=20pg_stat_get_dead_tuples('public.simport_ftable'::regclass),=0A+=20= =20=20=20=20=20=20= pg_stat_get_analyze_count('public.simport_ftable'::regclass);=0A=20=0A=20= ALTER=20TABLE=20simport_table=20ALTER=20COLUMN=20c1=20SET=20STATISTICS=20= 0;=0A=20ALTER=20TABLE=20simport_table=20ALTER=20COLUMN=20c2=20SET=20= STATISTICS=200;=0A@@=20-4604,7=20+4609,12=20@@=20ANALYZE=20= simport_ftable;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= --=20should=20fail=0A=20ALTER=20TABLE=20simport_table=20ALTER=20COLUMN=20= c2=20SET=20STATISTICS=20DEFAULT;=0A=20ANALYZE=20simport_table;=0A=20=0A= +SELECT=20= pg_stat_reset_single_table_counters('public.simport_ftable'::regclass);=0A= =20ANALYZE=20VERBOSE=20simport_ftable;=20=20=20=20=20=20=20=20=20=20=20= --=20should=20work=0A+SELECT=20pg_stat_force_next_flush();=0A+SELECT=20= pg_stat_get_live_tuples('public.simport_ftable'::regclass),=0A+=20=20=20=20= =20=20=20pg_stat_get_dead_tuples('public.simport_ftable'::regclass),=0A+=20= =20=20=20=20=20=20= pg_stat_get_analyze_count('public.simport_ftable'::regclass);=0A=20=0A=20= ANALYZE=20VERBOSE=20simport_ftable=20(c1);=20=20=20=20=20=20--=20should=20= work=0A=20=0A--=20=0A2.50.1=20(Apple=20Git-155)=0A=0A= --Apple-Mail=_17610643-A31A-4241-80B0-ACD76746931E--