Skip to content

Commit 188c8ea

Browse files
committed
Updated README with more information about the scripts.
1 parent ea4656a commit 188c8ea

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ Queries to estimate bloat in tables and indexes.
1111
index_bloat_check.sql
1212
---------------------
1313

14-
An overhauled index bloat check. Lists indexes which are likely to be bloated and estimates bloat amounts. Requires PostgreSQL > 8.4, superuser access, and a 64-bit compile.
14+
An overhauled index bloat check. Lists indexes which are likely to be bloated and estimates bloat amounts. Requires PostgreSQL > 8.4, superuser access, and a 64-bit compile. Only works for BTree indexes, not GIN, GiST, or more exotic indexes. Still needs cleanup.
1515

1616
table_bloat_check.sql
1717
---------------------
1818

1919
An overhauled table bloat check. Lists tables which are likely to be bloated and estimates bloat amounts. Requires PostgreSQL >= 8.4 and a 64-bit compile. Cannot estimate bloat for tables containing types with no stats functions (such as original JSON).
2020

21+
no_stats_table_check.sql
22+
------------------------
23+
24+
Query to list all tables which have "no stats" columns and thus can't be estimated.
25+
2126

2227
kill_idle
2328
=========
@@ -32,7 +37,20 @@ kill_idle_93.sql
3237

3338
A stored procedure which kills idle transactions on PostgreSQL versions 9.2 and later. Intended to be called by a cron job. Takes idle time and exempted user list parameters. Outputs JSON with the data about the sessions killed.
3439

40+
Indexes
41+
=======
42+
43+
Various queries to introspect index usage.
44+
45+
fk_no_index.sql
46+
---------------
3547

48+
Queries for foreign keys with no index on the referencing side. Note that you don't always want indexes on the referencing side, but this helps you decide if you do.
49+
50+
duplicate_indexes_fuzzy.sql
51+
---------------------------
52+
53+
Check indexes and looks at whether or not they are potentially duplicates. It does this by checking the columns used by each index, so it reports lots of false duplicates for partial and functional indexes.
3654

3755
Locks
3856
=====
@@ -49,13 +67,21 @@ Includes relation and query information, but realistically needs to be
4967
accompanied by full query logging to be useful. Needs to be run
5068
per active database.
5169

70+
table_locks.sql
71+
---------------
72+
73+
Lists direct locks on tables which conflict with locks held by other sessions. Note that table
74+
locks are often short-lived, and as a result this will often result in zero rows.
75+
5276

5377
Additional Contributors
5478
=======================
5579

5680
In addition to the staff of PostgreSQL Experts, we are indebted
5781
to:
5882

59-
* The authors of the check_postgres.pl script for supplying the
83+
* The authors of the check_postgres.pl script, especially
84+
Greg Sabino Mulainne, for supplying the
6085
original bloat queries on which our bloat queries are based.
61-
* Andrew Gierth for help on various system queries.
86+
* Andrew Gierth for help on various system queries.
87+
* ioguix for collaborating on bloat calculation math.

0 commit comments

Comments
 (0)