同时运行两者。不过,后者报告了一个错误:
discourse=# REINDEX SCHEMA CONCURRENTLY public;
ERROR: could not create unique index "index_users_on_username_lower_ccnew"
DETAIL: Key (username_lower)=(marks) is duplicated.
我想是时候深入研究 PostgreSQL,找到并删除那条记录了。
清理操作(vacuuming)大致奏效了,但我仍然每隔几分钟就会出现峰值,每次有 1 到 3 个 postmaster 进程持续占用 CPU 一到两分钟。所以我想问题还没完全解决。