GIN indexes not supported.
Got a workaround for this?
$ python pg_bloat_check.py -c dbname=my_db_name
Traceback (most recent call last):
File "pg_bloat_check.py", line 339, in <module>
get_bloat(conn, tuple(exclude_schema_list), tuple(include_schema_list), exclude_object_list)
File "pg_bloat_check.py", line 200, in get_bloat
cur.execute(sql, [o['oid'], args.min_size, args.min_wasted_size, args.min_wasted_percentage])
File "/usr/local/lib/python2.7/dist-packages/psycopg2/extras.py", line 120, in execute
return super(DictCursor, self).execute(query, vars)
psycopg2.NotSupportedError: "my_gin_index_idx" (gin index) is not supported
Unfortunately, I would expect most of the bloat in this db to be in the GIN indexes themselves.
Hmm... I'll have to see about exempting them for now. There's another function in pgstattuple that works with gin indexes, but not sure how to interpret its stats as it relates to bloat.
Just curious... for the index you believe is bloated, can you run pgstatginindex() on it and share the results? I don't have any clients using GIN indexes at the moment to look into that may have bloat.
# select pgstatginindex('redacted_index_name');
pgstatginindex
----------------
(2,39,940)
(1 row)
I don't particularly think it's bloated (yet), but this database has the potential for bloat, so I was interested in your new query.
Ok. I'll see if I can figure anything out. For now just working on a patch to leave GIN indexes out. Thankfully GIST seem to work.
Happy to help in any way possible.
If you come across any queries that are useful for determining GIN bloat, please share. :)
Released version 2.0.1 that filters out GIN indexes from scanning so it doesn't error out anymore. Thanks for reporting the issue! Hopefully find something that works eventually.