Re: [Patch] New pg_stat_tablespace view

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: songjinzhou <tsinghualucky912(at)foxmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, jian he <jian(dot)universality(at)gmail(dot)com>
Subject: Re: [Patch] New pg_stat_tablespace view
Date: 2026-08-28 02:52:13
Message-ID: CAGRkXqRV02=iEhpOa1=J8gtqwG5ZWs_TNDsqjPVNXggPW=8Mgg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 1, 2026 at 9:54 PM shihao zhong <zhong950419(at)gmail(dot)com> wrote:
>
> On Fri, Mar 27, 2026 at 2:05 PM shihao zhong <zhong950419(at)gmail(dot)com> wrote:
> >
> > On Tue, Mar 24, 2026 at 6:11 PM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
> > >
> > > Hello!
> > >
> > > blk_read_time and blk_write_time doesn't seem to work, they show 0 to
> > > me even after some workloads, and I don't see any assignments in the
> > > code. The testcase also checks for "blk_read_time >= 0" which
> > > trivially succeeds.
> > >
> > > blocks_fetched is also misleading, it includes both reads and cache
> > > hits. pg_stat_database calls this column blocks_read, and properly
> > > substracts blocks_hit from it.
> > >
> > > + rel->pgstat_info->reltablespace = rel->rd_locator.spcOid;
> > >
> > > Shouldn't this be included in TwoPhasePgStatRecord / pgstat_twophase_postcommit?
> > >
> > >
> >
> > Hi Zsolt and Jian,
> >
> > Thanks for the feedback. I've attached v3, addressing all comments.
> > Notably, I've included tuple-level stats in the pg_stat_tablespace
> > view to align with the addition of SpaceOid in TwoPhasePgStatRecord.
> >
> > Thanks,
> > Shihao
>
> Rebase with head.

Rebase the patch and fix a crash in standby.

Thanks,
Shihao

Attachment Content-Type Size
pg_stat_tablespace-v5.patch application/octet-stream 55.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-08-28 02:52:35 Re: pg_plan_advice: fix empty FOREIGN_JOIN sublist validation
Previous Message Chao Li 2026-08-28 02:51:52 Re: tablecmds: fix bug where index rebuild loses replica identity on partitions