Home Explore Blog CI



postgresql

7th chunk of `doc/src/sgml/pgstatstatements.sgml`
76d00735ec804d48bdefb05232c710288a7a69cbe7d075880000000100000fb5
 time spent by the statement on emitting code, in milliseconds
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>jit_deform_count</structfield> <type>bigint</type>
      </para>
      <para>
       Total number of tuple deform functions JIT-compiled by the statement
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>jit_deform_time</structfield> <type>double precision</type>
      </para>
      <para>
       Total time spent by the statement on JIT-compiling tuple deform
       functions, in milliseconds
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>parallel_workers_to_launch</structfield> <type>bigint</type>
      </para>
      <para>
       Number of parallel workers planned to be launched
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>parallel_workers_launched</structfield> <type>bigint</type>
      </para>
      <para>
       Number of parallel workers actually launched
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>stats_since</structfield> <type>timestamp with time zone</type>
      </para>
      <para>
       Time at which statistics gathering started for this statement
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>minmax_stats_since</structfield> <type>timestamp with time zone</type>
      </para>
      <para>
       Time at which min/max statistics gathering started for this
       statement (fields <structfield>min_plan_time</structfield>,
       <structfield>max_plan_time</structfield>,
       <structfield>min_exec_time</structfield> and
       <structfield>max_exec_time</structfield>)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   For security reasons, only superusers and roles with privileges of the
   <literal>pg_read_all_stats</literal> role are allowed to see the SQL text and
   <structfield>queryid</structfield> of queries executed by other users.
   Other users can see the statistics, however, if the view has been installed
   in their database.
  </para>

  <para>
   Plannable queries (that is, <command>SELECT</command>, <command>INSERT</command>,
   <command>UPDATE</command>, <command>DELETE</command>, and <command>MERGE</command>)
   and utility commands are combined into a single
   <structname>pg_stat_statements</structname> entry whenever they have identical query
   structures according to an internal hash calculation.  Typically, two
   queries will be considered the same for this purpose if they are
   semantically equivalent except for the values of literal constants
   appearing in the query.
  </para>

  <note>
   <para>
    The following details about constant replacement and
    <structfield>queryid</structfield> only apply when <xref
    linkend="guc-compute-query-id"/> is enabled.  If you use an external
    module instead to compute <structfield>queryid</structfield>, you
    should refer to its documentation for details.
   </para>
  </note>

  <para>
   When a constant's value has been ignored for purposes of matching the query
   to other queries, the constant is replaced by a parameter symbol, such
   as <literal>$1</literal>, in the <structname>pg_stat_statements</structname>
   display.
   The rest of the query text is that of the first query that had the
   particular <structfield>queryid</structfield> hash value associated with the
   <structname>pg_stat_statements</structname> entry.
  </para>

  <para>
   Queries on which normalization can be applied may be observed with constant
   values in <structname>pg_stat_statements</structname>,

Title: pg_stat_statements View Details and Security Considerations
Summary
The pg_stat_statements view provides detailed statistics about query execution, including parallel worker metrics, statistics gathering timestamps, and security restrictions on visibility of query text and queryid, with query normalization and constant replacement applied to group semantically equivalent queries together.