Sample Header Ad - 728x90

Is it possible to obtain number of prepared statements a connection holds?

4 votes
2 answers
2860 views
I have a heavy loaded application that holds connections persistently (it creates them on start and never releases). During the lifetime it creates and (re)uses prepared statements, which are stored in an LRU structure (so the least used are eventually released). And the question is: is it possible to obtain the number and other statistics of prepared statements for a given connection? There is nothing relevant on http://www.postgresql.org/docs/9.3/static/monitoring-stats.html so not sure if there are other interfaces to access postgresql stats. **UPD**: I probably was not clear enough: I need to obtain information using the normal DBA connection, since I cannot run arbitrary queries from the production software. For that very reason the pg_prepared_statements solution would not work.
Asked by zerkms (143 rep)
Nov 27, 2015, 03:55 AM
Last activity: Feb 4, 2024, 04:52 PM