Simulating Statspack AWR reports v16

When taking a snapshot, performance data from system catalog tables is saved into history tables. The following functions return information comparable to the information contained in an Oracle Statspack/Automatic Workload Repository (AWR) report. These reporting functions report on the differences between two given snapshots:

  • stat_db_rpt()
  • stat_tables_rpt()
  • statio_tables_rpt()
  • stat_indexes_rpt()
  • statio_indexes_rpt()

You can execute the reporting functions individually or you can execute all five functions by calling the edbreport() function.

edbreport()

The edbreport() function includes data from the other reporting functions, plus system information. The signature is:

edbreport(<beginning_id>, <ending_id>)

Parameters

beginning_id

An integer value that represents the beginning session identifier.

ending_id

An integer value that represents the ending session identifier.

The call to the edbreport() function returns a composite report that contains system information and the reports returned by the other statspack functions:

SELECT * FROM edbreport(9, 10);
Output
edbreport
--------------------------------------------------------------------------------------
    EnterpriseDB Report for database acctg             25-JUL-18
 Version: PostgreSQL 14.0 (EnterpriseDB EDB Postgres Advanced Server 14.0.0)on x86_64-pc-linux-gnu,
compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18), 64-bit

    Begin snapshot: 9 at 25-JUL-18 09:49:44.788392

    End snapshot: 10 at 25-JUL-18 09:49:49.855821

Size of database acctg is 173 MB
     Tablespace: pg_default Size: 231 MB Owner: enterprisedb
     Tablespace: pg_global Size: 719 kB Owner: enterprisedb

Schema: pg_toast_temp_1       Size: 0 bytes     Owner: enterprisedb
Schema: public                Size: 158 MB      Owner: enterprisedb

Report introduction

The information displayed in the report introduction includes the database name and version, the current date, the beginning and ending snapshot date and times, database and tablespace details, and schema information.

Output
Top 10 Relations by pages

TABLE                                        RELPAGES
-----------------------------------------------------
pgbench_accounts                             16394
pgbench_history                              391
pg_proc                                      145
pg_attribute                                 92
pg_depend                                    81
pg_collation                                 60
edb$stat_all_indexes                         46
edb$statio_all_indexes                       46
pg_description                               44
edb$stat_all_tables                          29

Top 10 Relations by pages

The information displayed in the Top 10 Relations by pages section includes:

Column nameDescription
TABLEThe name of the table
RELPAGESThe number of pages in the table
Output
Top 10 Indexes by pages

INDEX                                        RELPAGES
-----------------------------------------------------
pgbench_accounts_pkey                        2745
pg_depend_reference_index                    68
pg_depend_depender_index                     63
pg_proc_proname_args_nsp_index               53
pg_attribute_relid_attnam_index              25
pg_description_o_c_o_index                   24
pg_attribute_relid_attnum_index              17
pg_proc_oid_index                            14
pg_collation_name_enc_nsp_index              12
edb$stat_idx_pk                              10

Top 10 Indexes by pages

The information displayed in the Top 10 Indexes by pages section includes:

Column nameDescription
INDEXThe name of the index
RELPAGESThe number of pages in the index
Output
Top 10 Relations by DML

SCHEMA        RELATION                        UPDATES     DELETES    INSERTS
----------------------------------------------------------------------------
public        pgbench_accounts                117209      0          1000000
public        pgbench_tellers                 117209      0          100
public        pgbench_branches                117209      0          10
public        pgbench_history                 0           0          117209

Top 10 Relations by DML

The information displayed in the Top 10 Relations by DML section includes:

Column nameDescription
SCHEMAThe name of the schema in which the table resides
RELATIONThe name of the table
UPDATESThe number of UPDATES performed on the table
DELETESThe number of DELETES performed on the table
INSERTSThe number of INSERTS performed on the table
Output
DATA from pg_stat_database

DATABASE    NUMBACKENDS  XACT COMMIT   XACT ROLLBACK   BLKS READ  BLKS HIT HIT RATIO
-------------------------------------------------------------------------------------
acctg       0            8261          0               117        127985   99.91

DATA from pg_stat_database

The information displayed in the DATA from pg_stat_database section of the report includes:

Column nameDescription
DATABASEThe name of the database.
NUMBACKENDSNumber of backends currently connected to this database. This is the only column in this view that returns a value reflecting current state. All other columns return the accumulated values since the last reset.
XACT COMMITNumber of transactions in this database that were committed.
XACT ROLLBACKNumber of transactions in this database that were rolled back.
BLKS READNumber of disk blocks read in this database.
BLKS HITNumber of times disk blocks were found already in the buffer cache when a read wasn't necessary.
HIT RATIOThe percentage of times that a block was found in the shared buffer cache.
Output
DATA from pg_buffercache

RELATION                            BUFFERS
-------------------------------------------
pgbench_accounts                    16665
pgbench_accounts_pkey               2745
pgbench_history                     751
edb$statio_all_indexes              94
edb$stat_all_indexes                94
edb$stat_all_tables                 60
edb$statio_all_tables               56
edb$session_wait_history            34
edb$statio_idx_pk                   17
pg_depend                           17

DATA from pg_buffercache

The information displayed in the DATA from pg_buffercache section of the report includes:

Column nameDescription
RELATIONThe name of the table
BUFFERSThe number of shared buffers used by the relation
Note

To obtain the report for DATA from pg_buffercache, the pg_buffercache module must be installed in the database. Perform the installation using the CREATE EXTENSION command.

For more information on the CREATE EXTENSION command, see the PostgreSQL core documentation.

Output
DATA from pg_stat_all_tables ordered by seq scan

 SCHEMA                RELATION                     SEQ SCAN    REL TUP READ IDX SCAN
IDX TUP READ INS   UPD     DEL
-------------------------------------------------------------------------------------
----------------------------------
 public                pgbench_branches              8258        82580       0
0             0     8258    0
 public                pgbench_tellers               8258        825800      0
0             0     8258    0
 pg_catalog            pg_class                      7           3969        92
80            0     0       0
 pg_catalog            pg_index                      5           950         31
38            0     0       0
 pg_catalog            pg_namespace                  4           144         5
4             0     0       0
 pg_catalog            pg_database                   2           12          7
7             0     0       0
 pg_catalog            pg_am                         1           1           0
0             0     0       0
 pg_catalog            pg_authid                     1           10          2
2             0     0       0
 sys                   callback_queue_table          0           0           0
0             0     0       0
 sys                   edb$session_wait_history      0           0           0
0             125   0       0

DATA from pg_stat_all_tables ordered by seq scan

The information displayed in the DATA from pg_stat_all_tables ordered by seq scan section includes:

Column nameDescription
SCHEMAThe name of the schema in which the table resides
RELATIONThe name of the table
SEQ SCANThe number of sequential scans initiated on this table
REL TUP READThe number of tuples read in the table
IDX SCANThe number of index scans initiated on the table
IDX TUP READThe number of index tuples read
INSThe number of rows inserted
UPDThe number of rows updated
DELThe number of rows deleted
Output
DATA from pg_stat_all_tables ordered by rel tup read

 SCHEMA             RELATION                 SEQ SCAN  REL TUP READ IDX SCAN
IDX TUP READ INS  UPD    DEL
---------------------------------------------------------------------------
--------------------------------------------
 public             pgbench_tellers          8258      825800       0
0            0    8258   0
 public             pgbench_branches         8258      82580        0
0            0    8258   0
 pg_catalog         pg_class                 7         3969         92
80           0    0      0
 pg_catalog         pg_index                 5         950          31
38           0    0      0
 pg_catalog         pg_namespace             4         144          5
4            0    0      0
 pg_catalog         pg_database              2         12           7
7            0    0      0
 pg_catalog         pg_authid                1         10           2
2            0    0      0
 pg_catalog         pg_am                    1         1            0
0            0    0      0
 sys                callback_queue_table     0         0            0
0            0    0      0
 sys                edb$session_wait_history 0         0            0
0            125  0      0

DATA from pg_stat_all_tables ordered by rel tup read

The information displayed in the DATA from pg_stat_all_tables ordered by rel tup read section includes:

Column nameDescription
SCHEMAThe name of the schema in which the table resides
RELATIONThe name of the table
SEQ SCANThe number of sequential scans performed on the table
REL TUP READThe number of tuples read from the table
IDX SCANThe number of index scans performed on the table
IDX TUP READThe number of index tuples read
INSThe number of rows inserted
UPDThe number of rows updated
DELThe number of rows deleted
Output
DATA from pg_statio_all_tables

 SCHEMA               RELATION             HEAP     HEAP     IDX      IDX
TOAST     TOAST     TIDX    TIDX
                                           READ     HIT      READ     HIT
READ      HIT       READ    HIT
-----------------------------------------------------------------------------------
------------------------------
 public               pgbench_accounts     32       25016     0       49913
0         0         0       0
 public               pgbench_tellers      0        24774     0       0
0         0         0       0
 public               pgbench_branches     0        16516     0       0
0         0         0       0
 public               pgbench_history      53       8364      0       0
0         0         0       0
 pg_catalog           pg_class             0        199       0       187
0         0         0       0
 pg_catalog           pg_attribute         0        198       0       395
0         0         0       0
 pg_catalog           pg_proc              0        75        0       153
0         0         0       0
 pg_catalog           pg_index             0        56        0       33
0         0         0       0
 pg_catalog           pg_amop              0        48        0       56
0         0         0       0
 pg_catalog           pg_namespace         0        28        0       7
0         0         0       0

DATA from pg_statio_all_tables

The information displayed in the DATA from pg_statio_all_tables section includes:

Column nameDescription
SCHEMAThe name of the schema in which the table resides
RELATIONThe name of the table
HEAP READThe number of heap blocks read
HEAP HITThe number of heap blocks hit
IDX READThe number of index blocks read
IDX HITThe number of index blocks hit
TOAST READThe number of toast blocks read
TOAST HITThe number of toast blocks hit
TIDX READThe number of toast index blocks read
TIDX HITThe number of toast index blocks hit
Output
DATA from pg_stat_all_indexes

 SCHEMA                  RELATION                    INDEX
IDX SCAN     IDX TUP READ IDX TUP FETCH
------------------------------------------------------------------------------
-------------------------------------------
 public                  pgbench_accounts            pgbench_accounts_pkey
16516        16679         16516
 pg_catalog              pg_attribute
pg_attribute_relid_attnum_index   196               402          402
 pg_catalog              pg_proc                     pg_proc_oid_index
70           70            70
 pg_catalog              pg_class                    pg_class_oid_index
61           61            61
 pg_catalog              pg_class                    pg_class_relname_nsp_index
31           19            19
 pg_catalog              pg_type                     pg_type_oid_index
22           22            22
 pg_catalog             edb_policy                   edb_policy_object_name_index
21           0             0
 pg_catalog             pg_amop                      pg_amop_fam_strat_index
16           16            16
 pg_catalog             pg_index                     pg_index_indexrelid_index
16           16            16
 pg_catalog             pg_index                     pg_index_indrelid_index
15           22            22

DATA from pg_stat_all_indexes

The information displayed in the DATA from pg_stat_all_indexes section includes:

Column nameDescription
SCHEMAThe name of the schema in which the index resides
RELATIONThe name of the table on which the index is defined
INDEXThe name of the index
IDX SCANThe number of indexes scans initiated on this index
IDX TUP READNumber of index entries returned by scans on this index
IDX TUP FETCHNumber of live table rows fetched by simple index scans using this index
Output
DATA from pg_statio_all_indexes

 SCHEMA            RELATION                  INDEX
IDX BLKS READ IDX BLKS HIT
------------------------------------------------------------------------
------------------------------------------
 public            pgbench_accounts          pgbench_accounts_pkey
0             49913
 pg_catalog        pg_attribute
pg_attribute_relid_attnum_index    0             395
 sys               edb$stat_all_indexes      edb$stat_idx_pk
1            382
 sys               edb$statio_all_indexes    edb$statio_idx_pk
1            382
 sys               edb$statio_all_tables     edb$statio_tab_pk
2            262
 sys               edb$stat_all_tables       edb$stat_tab_pk
0            259
 sys               edb$session_wait_history  session_waits_hist_pk
0            251
 pg_catalog        pg_proc                   pg_proc_oid_index
0            142
 pg_catalog        pg_class                  pg_class_oid_index
0            123
 pg_catalog        pg_class                  pg_class_relname_nsp_index
0            63

DATA from pg_statio_all_indexes

The information displayed in the DATA from pg_statio_all_indexes section includes:

Column nameDescription
SCHEMAThe name of the schema in which the index resides
RELATIONThe name of the table on which the index is defined
INDEXThe name of the index
IDX BLKS READThe number of index blocks read
IDX BLKS HITThe number of index blocks hit
Output
System Wait Information

WAIT NAME                              COUNT        WAIT TIME        % WAIT
---------------------------------------------------------------------------
wal flush                              8359         1.357593          30.62
wal write                              8358         1.349153          30.43
wal file sync                          8358         1.286437          29.02
query plan                             33439        0.439324          9.91
db file extend                         54           0.000585          0.01
db file read                           31           0.000307          0.01
other lwlock acquire                   0            0.000000          0.00
ProcArrayLock                          0            0.000000          0.00
CLogControlLock                        0            0.000000          0.00

System Wait Information

The information displayed in the System Wait Information section includes:

Column nameDescription
WAIT NAMEThe name of the wait
COUNTThe number of times that the wait event occurred
WAIT TIMEThe length of the wait time in seconds
% WAITThe percentage of the total wait time used by this wait for this session
Output
Database Parameters from postgresql.conf

 PARAMETER                             SETTING
CONTEXT       MINVAL         MAXVAL
----------------------------------------------------------------------
---------------------------------------------------
 allow_system_table_mods               off
postmaster
 application_name                      psql.bin
user
 archive_command                       (disabled)
sighup
 archive_mode                          off
postmaster
 archive_timeout                       0
sighup      0               1073741823
 array_nulls                           on
user
 authentication_timeout                60
sighup       1              600
 autovacuum                            on
sighup
 autovacuum_analyze_scale_factor       0.1
sighup       0              100
 autovacuum_analyze_threshold          50
sighup       0              2147483647
 autovacuum_freeze_max_age             200000000
postmaster   100000         2000000000
 autovacuum_max_workers                3
postmaster   1              262143
 autovacuum_multixact_freeze_max_age   400000000
postmaster   10000          2000000000
 autovacuum_naptime                    60
sighup       1            2147483
 autovacuum_vacuum_cost_delay           20
sighup      -1              100
                        .
                        .
                        .

Database Parameters from postgresql.conf

The information displayed in the Database Parameters from postgresql.conf section includes:

Column nameDescription
PARAMETERThe name of the parameter
SETTINGThe current value assigned to the parameter
CONTEXTThe context required to set the parameter value
MINVALThe minimum value allowed for the parameter
MAXVALThe maximum value allowed for the parameter

stat_db_rpt()

The signature is:

stat_db_rpt(<beginning_id>, <ending_id>)

Parameters

beginning_id

An integer value that represents the beginning session identifier.

ending_id

An integer value that represents the ending session identifier.

This example shows the stat_db_rpt() function:

SELECT * FROM stat_db_rpt(9, 10);
Output
stat_db_rpt
-------------------------------------------------------------------------------------
   DATA from pg_stat_database

DATABASE  NUMBACKENDS   XACT COMMIT  XACT ROLLBACK  BLKS READ  BLKS HIT HIT RATIO
-------------------------------------------------------------------------------------
acctg     0             8261         0              117        127985   99.91
(5 rows)

DATA from pg_stat_database

The information displayed in the DATA from pg_stat_database section of the report includes:

Column nameDescription
DATABASEThe name of the database.
NUMBACKENDSNumber of backends currently connected to this database. This is the only column in this view that returns a value reflecting current state. All other columns return the accumulated values since the last reset.
XACT COMMITThe number of transactions in this database that were committed.
XACT ROLLBACKThe number of transactions in this database that were rolled back.
BLKS READThe number of blocks read.
BLKS HITThe number of blocks hit.
HIT RATIOThe percentage of times that a block was found in the shared buffer cache.

stat_tables_rpt()

The signature is:

function_name(<beginning_id>, <ending_id>, <top_n>, <scope>)

Parameters

beginning_id

An integer value that represents the beginning session identifier.

ending_id

An integer value that represents the ending session identifier.

top_n

The number of rows to return.

scope

Determines the tables the function returns statistics about. Specify SYS, USER, or ALL:

  • Use SYS to return information about system-defined tables. A table is considered a system table if it's stored in the pg_catalog, information_schema, or sys schema.
  • Use USER to return information about user-defined tables.
  • Use ALL to return information about all tables.

The stat_tables_rpt() function returns a two-part report. The first portion of the report contains:

SELECT * FROM stat_tables_rpt(8, 9, 10, 'ALL');
Output
stat_tables_rpt
----------------------------------------------------------------------------
   DATA from pg_stat_all_tables ordered by seq scan

 SCHEMA               RELATION                      SEQ SCAN   REL TUP READ IDX SCAN
IDX TUP READ INS   UPD    DEL
-------------------------------------------------------------------------------------
----------------------------------
 public               pgbench_branches               8249       82490       0
0            0    8249    0
 public               pgbench_tellers                8249       824900      0
0            0    8249    0
 pg_catalog           pg_class                       7          3969        92
80           0    0       0
 pg_catalog           pg_index                       5          950         31
38           0    0       0
 pg_catalog           pg_namespace                   4          144         5
4            0    0       0
 pg_catalog           pg_am                          1          1           0
0            0    0       0
 pg_catalog           pg_authid                      1          10          2
2            0    0       0
 pg_catalog           pg_database                    1          6           3
3            0    0       0
 sys                  callback_queue_table           0          0           0
0            0    0       0
 sys                 edb$session_wait_history        0          0           0
0            125 0        0

DATA from pg_stat_all_tables ordered by seq scan

The information displayed in the DATA from pg_stat_all_tables ordered by seq scan section includes:

Column nameDescription
SCHEMAThe name of the schema in which the table resides
RELATIONThe name of the table
SEQ SCANThe number of sequential scans on the table
REL TUP READThe number of tuples read from the table
IDX SCANThe number of index scans performed on the table
IDX TUP READThe number of index tuples read from the table
INSThe number of rows inserted
UPDThe number of rows updated
DELThe number of rows deleted

The second portion of the report contains:

Output
DATA from pg_stat_all_tables ordered by rel tup read

 SCHEMA               RELATION                 SEQ SCAN REL   TUP READ   IDX SCAN
IDX TUP READ INS    UPD     DEL
-----------------------------------------------------------------------------
--------------------------------------
 public               pgbench_tellers          8249          824900      0
0            0     8249     0
 public               pgbench_branches         8249          82490       0
0            0     8249     0
 pg_catalog           pg_class                 7             3969        92
80           0     0        0
 pg_catalog           pg_index                 5             950         31
38           0     0        0
 pg_catalog           pg_namespace             4             144         5
4            0     0        0
 pg_catalog           pg_authid                1             10          2
2            0     0        0
 pg_catalog           pg_database              1             6           3
3            0     0        0
 pg_catalog           pg_am                    1             1           0
0            0     0        0
 sys                  callback_queue_table     0             0           0
0            0     0        0
 sys                  edb$session_wait_history 0             0           0
0            125   0        0
(29 rows)

DATA from pg_stat_all_tables ordered by rel tup read

The information displayed in the DATA from pg_stat_all_tables ordered by rel tup read section includes:

Column nameDescription
SCHEMAThe name of the schema in which the table resides
RELATIONThe name of the table
SEQ SCANThe number of sequential scans performed on the table
REL TUP READThe number of tuples read from the table
IDX SCANThe number of index scans performed on the table
IDX TUP READThe number of live rows fetched by index scans
INSThe number of rows inserted
UPDThe number of rows updated
DELThe number of rows deleted

statio_tables_rpt()

The signature is:

statio_tables_rpt(<beginning_id>, <ending_id>, <top_n>, <scope>)

Parameters

beginning_id

An integer value that represents the beginning session identifier.

ending_id

An integer value that represents the ending session identifier.

top_n

The number of rows to return.

scope

Determines the tables the function returns statistics about. Specify SYS, USER or ALL:

  • Use SYS to return information about system-defined tables. A table is considered a system table if it's stored the pg_catalog, information_schema, or sys schema.
  • Use USER to return information about user-defined tables.
  • Use ALL to return information about all tables.

The statio_tables_rpt() function returns a report that contains:

SELECT * FROM statio_tables_rpt(9, 10, 10, 'SYS');
Output
statio_tables_rpt
------------------------------------------------------------------------------------
-------------------------------
    DATA from pg_statio_all_tables

 SCHEMA                  RELATION             HEAP     HEAP    IDX    IDX   TOAST
TOAST      TIDX      TIDX
                                              READ     HIT     READ   HIT   READ
                                                
HIT        READ      HIT
-------------------------------------------------------------------------------------
----------------------------
 sys                     edb$stat_all_indexes 8        18      1       382   0
0          0         0
 sys                     edb$statio_all_index 8        18      1       382   0
0          0         0
 sys                     edb$statio_all_table 5        12      2       262   0
0          0         0
 sys                     edb$stat_all_tables  4        10      0       259   0
0          0         0
 sys                     edb$session_wait_his 2        6       0       251   0
0          0         0
 sys                     edb$session_waits    1        4       0       12    0
0          0         0
 sys                     callback_queue_table 0        0       0       0     0
0          0         0
 sys                     dual                 0        0       0       0     0
0          0         0
 sys                    edb$snap              0        1       0       2     0
0          0         0
 sys                    edb$stat_database     0        2       0       7     0
0          0         0
(15 rows)

DATA from pg_statio_all_tables

The information displayed in the DATA from pg_statio_all_tables section includes:

Column nameDescription
SCHEMAThe name of the schema in which the relation resides
RELATIONThe name of the relation
HEAP READThe number of heap blocks read
HEAP HITThe number of heap blocks hit
IDX READThe number of index blocks read
IDX HITThe number of index blocks hit
TOAST READThe number of toast blocks read
TOAST HITThe number of toast blocks hit
TIDX READThe number of toast index blocks read
TIDX HITThe number of toast index blocks hit

stat_indexes_rpt()

The signature is:

stat_indexes_rpt(<beginning_id>, <ending_id>, <top_n>, <scope>)

Parameters

beginning_id

An integer value that represents the beginning session identifier.

ending_id

An integer value that represents the ending session identifier.

top_n

The number of rows to return.

scope

Determines the tables the function returns statistics about. Specify SYS, USER or ALL:

  • Use SYS to return information about system-defined tables. A table is considered a system table if it's stored in the pg_catalog, information_schema, or sys schema.
  • Use USER to return information about user-defined tables.
  • Use ALL to return information about all tables.

The stat_indexes_rpt() function returns a report that contains:

edb=# SELECT * FROM stat_indexes_rpt(9, 10, 10, 'ALL');
Output
stat_indexes_rpt
-------------------------------------------------------------------------------
---------------------------------------------
     DATA from pg_stat_all_indexes

 SCHEMA                   RELATION                  INDEX
IDX SCAN       IDX TUP READ IDX TUP FETCH
-------------------------------------------------------------------------------
------------------------------------------
 public                   pgbench_accounts          pgbench_accounts_pkey
16516          16679        16516
 pg_catalog               pg_attribute
pg_attribute_relid_attnum_index      196           402      402
 pg_catalog               pg_proc                   pg_proc_oid_index
70             70           70
 pg_catalog               pg_class                  pg_class_oid_index
61             61           61
 pg_catalog               pg_class                  pg_class_relname_nsp_index
31             19           19
 pg_catalog               pg_type                   pg_type_oid_index
22             22           22
 pg_catalog               edb_policy                edb_policy_object_name_index
21             0            0
 pg_catalog               pg_amop                   pg_amop_fam_strat_index
16             16           16
 pg_catalog               pg_index                  pg_index_indexrelid_index
16             16           16
 pg_catalog               pg_index                  pg_index_indrelid_index
15             22           22
(14 rows)

DATA from pg_stat_all_indexes

The information displayed in the DATA from pg_stat_all_indexes section includes:

Column nameDescription
SCHEMAThe name of the schema in which the relation resides
RELATIONThe name of the relation
INDEXThe name of the index
IDX SCANThe number of indexes scanned
IDX TUP READThe number of index tuples read
IDX TUP FETCHThe number of index tuples fetched

statio_indexes_rpt()

The signature is:

statio_indexes_rpt(<beginning_id>, <ending_id>, <top_n>, <scope>)

Parameters

beginning_id

An integer value that represents the beginning session identifier.

ending_id

An integer value that represents the ending session identifier.

top_n

The number of rows to return.

scope

Determines the tables the function returns statistics about. Specify SYS, USER or ALL:

  • Use SYS to return information about system-defined tables. A table is considered a system table if it's stored in the pg_catalog, information_schema, or sys schema.
  • Use USER to return information about user-defined tables.
  • Use ALL to return information about all tables.

The statio_indexes_rpt() function returns a report that contains:

edb=# SELECT * FROM statio_indexes_rpt(9, 10, 10, 'SYS');
Output
statio_indexes_rpt
----------------------------------------------------------------------------
------------------------------------
  DATA from pg_statio_all_indexes

 SCHEMA                      RELATION                       INDEX
IDX BLKS READ         IDX BLKS HIT
----------------------------------------------------------------------------
---------------------------------
 pg_catalog                 pg_attribute
pg_attribute_relid_attnum_index          0                      395
 sys                        edb$stat_all_indexes           edb$stat_idx_pk
1                    382
 sys                        edb$statio_all_indexes         edb$statio_idx_pk
1                    382
 sys                        edb$statio_all_tables          edb$statio_tab_pk
2                    262
 sys                        edb$stat_all_tables            edb$stat_tab_pk
0                    259
 sys                        edb$session_wait_history       session_waits_hist_pk
0                    251
 pg_catalog                 pg_proc                        pg_proc_oid_index
0                    142
 pg_catalog                 pg_class                       pg_class_oid_index
0                    123
 pg_catalog                 pg_class                       pg_class_relname_nsp_index
0                    63
 pg_catalog                 pg_type                        pg_type_oid_index
0                    45
(14 rows)

DATA from pg_statio_all_indexes

The information displayed in the DATA from pg_statio_all_indexes report includes:

Column nameDescription
SCHEMAThe name of the schema in which the relation resides
RELATIONThe name of the table on which the index is defined
INDEXThe name of the index
IDX BLKS READThe number of index blocks read
IDX BLKS HITThe number of index blocks hit