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

From Kasahara Tatsuhito
Subject Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE
Date
Msg-id CAP0=ZV+gdKVNxoy90-imBOvFR2P2SZXeDDSBaU7=SAGcWxaAmA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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 would
> expect to see.
Yeah.

So I expected following result after performing second time "SELECT *
FROM tt WHERE c1 = $1" in a  previous e-mail.

=# SELECT queryid, calls, query FROM pg_stat_statements WHERE query LIKE
'%tt%';
  queryid  | calls |                       query
-----------+-------+----------------------------------------------------
 575935600 |    1| PREPARE p1(int) AS SELECT * FROM tt WHERE c1 = $1;
 other-queryid |    10 | SELECT * FROM tt WHERE c1 = $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 ?

--
Tatsuhito Kasahara
kasahara.tatsuhito _at_ gmail.com

pgsql-bugs by date:

Previous
From: ranier_gyn@hotmail.com
Date:
Subject: BUG #13981: Possible HANDLE LEAK
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE