Re: Statistics Import and Export

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, alvherre(at)alvh(dot)no-ip(dot)org
Subject: Re: Statistics Import and Export
Date: 2024-08-09 01:32:23
Message-ID: 123a334d07504f57fa4b5f84444cf4dc77d67c58.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 2024-07-27 at 21:08 -0400, Corey Huinker wrote:
>
> Attached is v25.

I attached new versions of 0001 and 0002. Still working on them, so
these aren't final.

v25j-0001:

* There seems to be confusion between the relation for which we are
updating the stats, and pg_class. Permissions and ShareUpdateExclusive
should be taken on the former, not the latter. For consistency with
vac_update_relstats(), RowExclusiveLock should be fine on pg_class.
* Lots of unnecessary #includes were removed.
* I refactored substantially to do basic checks in the SQL function
pg_set_relation_stats() and make calling the internal function easier.
Similar refactoring might not work for pg_set_attribute_stats(), but
that's OK.
* You don't need to declare the SQL function signatures. They're
autogenerated from pg_proc.dat into fmgrprotos.h.
* I removed the inplace stuff for this patch because there's no
coverage for it and it can be easily added back in 0003.
* I renamed the file to import_stats.c. Annoying to rebase, I know,
but better now than later.

v25j-0002:

* I just did some minor cleanup on the #includes and rebased it. I
still need to look in more detail.

Regards,
Jeff Davis

Attachment Content-Type Size
v25j-0001-Create-function-pg_set_relation_stats.patch text/x-patch 17.0 KB
v25j-0002-Create-function-pg_set_attribute_stats.patch text/x-patch 89.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Xiaoran Wang 2024-08-09 02:27:35 Re: [patch] Imporve pqmq
Previous Message Melanie Plageman 2024-08-09 01:29:15 Re: Add LSN <-> time conversion functionality