You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,18 @@ Queries to estimate bloat in tables and indexes.
11
11
index_bloat_check.sql
12
12
---------------------
13
13
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.
15
15
16
16
table_bloat_check.sql
17
17
---------------------
18
18
19
19
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).
20
20
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
+
21
26
22
27
kill_idle
23
28
=========
@@ -32,7 +37,20 @@ kill_idle_93.sql
32
37
33
38
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.
34
39
40
+
Indexes
41
+
=======
42
+
43
+
Various queries to introspect index usage.
44
+
45
+
fk_no_index.sql
46
+
---------------
35
47
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.
36
54
37
55
Locks
38
56
=====
@@ -49,13 +67,21 @@ Includes relation and query information, but realistically needs to be
49
67
accompanied by full query logging to be useful. Needs to be run
50
68
per active database.
51
69
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
+
52
76
53
77
Additional Contributors
54
78
=======================
55
79
56
80
In addition to the staff of PostgreSQL Experts, we are indebted
57
81
to:
58
82
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
60
85
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