# Use amcheck to Check PostgreSQL Index Integrity (Corruption)

**URL:** https://meta.discourse.org/t/use-amcheck-to-check-postgresql-index-integrity-corruption/153207
**Category:** Sysadmins
**Tags:** how-to
**Created:** [May 29, 2020, 9:57am UTC](https://meta.discourse.org/t/use-amcheck-to-check-postgresql-index-integrity-corruption/153207 "2020-05-29T09:57:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [May 29, 2020, 9:57am UTC](https://meta.discourse.org/t/use-amcheck-to-check-postgresql-index-integrity-corruption/153207/1 "2020-05-29T09:57:52Z")

</div>

Lately, I have read a number of Discourse topics on meta about “index corruption” in both PostgreSQL 10 and 12.

One of the take-a-ways from these discussions is that it _may_ be important or interesting for some sys admins to check the integrity of their Discourse PostgreSQL 10 indexes if they are experiencing performance problems or perhaps before performing an upgrade to PostgreSQL 12.

For those who might want to perform this check, I have tested `amcheck` on two differernt Discourse (PostgreSQL 10) installations. The check went flawlessly on both a (1) “two container” setup and a (2) standalone single container setup.

Here is my discussion on how to check for index corruption for Discourse PostgreSQL 10 configurations, and my results:

> **[Using amcheck to check PostgreSQL 10 indexes for corruption (integrity checking)](https://community.unix.com/t/using-amcheck-to-check-postgresql-10-indexes-for-corruption-integrity-checking/378659)**
>
> Motivation There has been some discussions over at meta discourse lately about PostgresSQL 10 and 12 indexes being corrupt. We have yet to see this in practice using Discourse; however, it is certainly a good idea check indexes and verify they...

I hope this brief write up on `amcheck` and Discourse (PostgreSQL 10) will help any Discourse sys admin who may be interested in using `amcheck` to check their DBs for corrupt indexes.
