Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE
Date
Msg-id CAKFQuwbqc=L3LfH-aNBCyipjg3hjWe6nSBaLwBCr-abMSxxtCQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE  (Kasahara Tatsuhito <kasahara.tatsuhito@gmail.com>)
Responses Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE
List pgsql-bugs
On Tue, Feb 23, 2016 at 8:24 AM, Kasahara Tatsuhito <
kasahara.tatsuhito@gmail.com> wrote:

> 2016-02-23 23:36 GMT+09:00 David G. Johnston <david.g.johnston@gmail.com>=
:
> > You need to tell people what exactly you think is strange/what you woul=
d
> > expect to see.
> Yeah.
>
> So I expected following result after performing second time "SELECT *
> FROM tt WHERE c1 =3D $1" in a  previous e-mail.
>
> =3D# SELECT queryid, calls, query FROM pg_stat_statements WHERE query LIK=
E
> '%tt%';
>   queryid  | calls |                       query
> -----------+-------+----------------------------------------------------
>  575935600 |    1| PREPARE p1(int) AS SELECT * FROM tt WHERE c1 =3D $1;
>  other-queryid |    10 | SELECT * FROM tt WHERE c1 =3D $1;
> (2 row)
>
> But actually SELECT was counted  as PREPARE in pg_stat_statements.
> That's what I thought strange.
>
> It seems to me that "<query>" and "PREPARE <query>" always have same
> queryid.
> Therefore should I consider these queries as the same one ?
>
>
=E2=80=8BWhat do you think the following statement does?

=E2=80=8B
PreparedStatement ps1 =3D con.prepareStatement(sql1);

=E2=80=8BDavid J.
=E2=80=8B

pgsql-bugs by date:

Previous
From: Kasahara Tatsuhito
Date:
Subject: Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE
Next
From: Tom Lane
Date:
Subject: Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE