Re: Statistics Import and Export

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, jian he <jian(dot)universality(at)gmail(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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>, alvherre(at)alvh(dot)no-ip(dot)org, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Statistics Import and Export
Date: 2025-01-21 02:25:14
Message-ID: CADkLM=d4H3FW5AJ6B79DveeucGzHXnx_6wSPGStWf+rOC=3Pxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
> * For indexes, it looks like do_analyze_rel is opening the parent table
> with ShareUpdateExclusive and the indexes with just AccessShare. Let's
> follow that pattern.
>

Done.

>
> * The import code allows setting stats for partitioned indexes while
> ANALYZE does not, so it's hard to say for sure what we should do for
> partitioned indexes. I suggest we treat them the same as ordinary
> indexes. Alternatively, we could refuse to set stats on a partitioned
> index, but the rest of the import feature is generally permissive about
> what can be set, so I'm inclined to just treat them like ordinary
> indexes with respect to locking semantics.
>

I tried that, adding a test for it. Treating partitioned indexes like
regular indexes causes the exact same error as was initially reported for
indexes, so I took it back out.

Updated attached, burning numbers in the stats-sequence even though the
pg_dump patches have been left out for the time being.

Attachment Content-Type Size
v40-0001-Lock-table-first-when-setting-index-relation-sta.patch text/x-patch 5.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-01-21 02:45:14 Re: Update Unicode data to Unicode 16.0.0
Previous Message Tom Lane 2025-01-21 02:02:42 Re: pg_createsubscriber TAP test wrapping makes command options hard to read.