阅读背景:

选择Count(*)由postgres数据库(391K行)的<30s到~8分钟增加到~8分钟。

来源:互联网 

I have a relatively small database that consists of 12 tables. 3 tables serve the majority content on one of my websites. Approximately 24 hours ago I ran a small script that would do nothing more than update/delete some rows (~10k) in these tables in quick sucession. This was a script that I had run before plenty of times and is just something I use to clean up unnecessary content within this table. After about an hour of running this script I was and still am hit with an unnecessarily high amount of request timeouts from heroku. Since I had not touched anything with the project specifically I concluded that something must be going on with the database. I then proceeded to kill all open database connections and found that the timeouts stopped. Again after 10 minutes or so timeouts would start again. Looking at the queries being executed I saw that everytime that timeouts would happen is when there were 4-5 long running queries. All of these queries are either I have a relatively small database that consist




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: