Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/pgstatstatements.sgml`
c1f1d910c635c5c16ef23d54bc46522b2743a0c23a1bf4f30000000100000fa5
 role="catalog_table_entry"><para role="column_definition">
       <structfield>dbid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-database"><structname>pg_database</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       OID of database in which the statement was executed
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>toplevel</structfield> <type>bool</type>
      </para>
      <para>
       True if the query was executed as a top-level statement
       (always true if <varname>pg_stat_statements.track</varname> is set to
       <literal>top</literal>)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>queryid</structfield> <type>bigint</type>
      </para>
      <para>
       Hash code to identify identical normalized queries.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>query</structfield> <type>text</type>
      </para>
      <para>
       Text of a representative statement
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>plans</structfield> <type>bigint</type>
      </para>
      <para>
       Number of times the statement was planned
       (if <varname>pg_stat_statements.track_planning</varname> is enabled,
       otherwise zero)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>total_plan_time</structfield> <type>double precision</type>
      </para>
      <para>
       Total time spent planning the statement, in milliseconds
       (if <varname>pg_stat_statements.track_planning</varname> is enabled,
       otherwise zero)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>min_plan_time</structfield> <type>double precision</type>
      </para>
      <para>
       Minimum time spent planning the statement, in milliseconds.
       This field will be zero if <varname>pg_stat_statements.track_planning</varname>
       is disabled, or if the counter has been reset using the
       <function>pg_stat_statements_reset</function> function with the
       <structfield>minmax_only</structfield> parameter set to <literal>true</literal>
       and never been planned since.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>max_plan_time</structfield> <type>double precision</type>
      </para>
      <para>
       Maximum time spent planning the statement, in milliseconds.
       This field will be zero if <varname>pg_stat_statements.track_planning</varname>
       is disabled, or if the counter has been reset using the
       <function>pg_stat_statements_reset</function> function with the
       <structfield>minmax_only</structfield> parameter set to <literal>true</literal>
       and never been planned since.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>mean_plan_time</structfield> <type>double precision</type>
      </para>
      <para>
       Mean time spent planning the statement, in milliseconds
       (if <varname>pg_stat_statements.track_planning</varname> is enabled,
       otherwise zero)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>stddev_plan_time</structfield> <type>double precision</type>
      </para>
      <para>
       Population standard deviation of time spent planning the statement,
       in milliseconds
       (if <varname>pg_stat_statements.track_planning</varname>

Title: pg_stat_statements View Columns
Summary
The pg_stat_statements view contains various columns to track statistics of SQL statements, including database ID, user ID, query ID, query text, planning and execution times, and more. The columns provide insights into statement planning and execution, such as the number of times a statement was planned, total planning time, minimum, maximum, and mean planning times, and standard deviation of planning time.