postgres truncate is slow

后端 未结 4 1503
孤城傲影
孤城傲影 2021-01-11 23:02

In postgres 9.2 (CentOS), TRUNCATE TABLE command occasionally took a really long time to run. One time, it took more than 1.5 hours to truncate a table with 100K records, ev

4条回答
  •  無奈伤痛
    2021-01-11 23:30

    This just happened to me and my team. We are using Postgres 12 and were doing some processing using Apache NiFi. It got stuck.

    We did a:

    systemctl status postgresql-12
    

    Then I noticed a lot of "TRUNCATED Waiting" I proceeded to try and reload Postgres without success and then just killed each of the stuck processes.

    It worked after that and we were able to restart the jobs and only took less than a seccond.

提交回复
热议问题