Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GIN indexes not supported. #1

Open
coreyatmoat opened this issue May 27, 2016 · 7 comments
Open

GIN indexes not supported. #1

coreyatmoat opened this issue May 27, 2016 · 7 comments

Comments

@coreyatmoat
Copy link

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.

@keithf4
Copy link
Owner

keithf4 commented May 27, 2016

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.

@keithf4
Copy link
Owner

keithf4 commented May 27, 2016

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.

@coreyatmoat
Copy link
Author

coreyatmoat commented May 27, 2016

# 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.

@keithf4
Copy link
Owner

keithf4 commented May 27, 2016

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.

@coreyatmoat
Copy link
Author

Happy to help in any way possible.

@keithf4
Copy link
Owner

keithf4 commented May 27, 2016

If you come across any queries that are useful for determining GIN bloat, please share. :)

@keithf4
Copy link
Owner

keithf4 commented May 27, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants