Re: [BUG] pg_stat_statements and extended query protocol

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, David Zhang <david(dot)zhang(at)highgo(dot)ca>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUG] pg_stat_statements and extended query protocol
Date: 2023-04-04 03:13:12
Message-ID: 1311773.1680577992@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Imseih (AWS), Sami" <simseih(at)amazon(dot)com> writes:
> I wonder if the right answer here is to track fetches as
> a separate counter in pg_stat_statements, in which fetch
> refers to the number of times a portal is executed?

Maybe, but is there any field demand for that?

IMV, the existing behavior is that we count one "call" per overall
query execution (that is, per ExecutorEnd invocation). The argument
that that's a bug and we should change it seems unsupportable to me,
and even the argument that we should also count ExecutorRun calls
seems quite lacking in evidence. We clearly do need to fix the
reported rowcount for cases where ExecutorRun is invoked more than
once per ExecutorEnd call; but I think that's sufficient.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2023-04-04 03:21:44 RE: Support logical replication of DDLs
Previous Message houzj.fnst@fujitsu.com 2023-04-04 03:13:09 RE: Support logical replication of DDLs