Why does PostgresQL query performance drop over time, but restored when rebuilding index

后端 未结 5 1166
慢半拍i
慢半拍i 2021-01-31 18:59

According to this page in the manual, indexes don\'t need to be maintained. However, we are running with a PostgresQL table that has a continuous rate of upd

5条回答
  •  遥遥无期
    2021-01-31 19:37

    This smells like index bloat to me. I'l refer you to this page

    http://www.postgresql.org/docs/8.3/static/routine-reindex.html

    which says at the bottom:

    Also, for B-tree indexes a freshly-constructed index is somewhat faster to access than one that has been updated many times, because logically adjacent pages are usually also physically adjacent in a newly built index. (This consideration does not currently apply to non-B-tree indexes.) It might be worthwhile to reindex periodically just to improve access speed.

    Which does seem to conflict with the page you referenced saying that indexes "don't require maintenance or tuning".

    Have you tried "create index concurrently"?

提交回复
热议问题