-
Bug
-
Resolution: Fixed
-
Normal
-
None
-
None
-
None
The SQL to calculate statistics over our editor table takes too long to run, and thus the request times out:
Aug 8 06:59:10 totoro postgres[28158]: [2-1] ERROR: canceling statement due to user request
Aug 8 06:59:10 totoro postgres[28158]: [2-2] STATEMENT: SELECT editor, count(vote.id) FROM vote
Aug 8 06:59:10 totoro postgres[28158]: [2-3] #011 JOIN editor ON vote.editor = editor.id
Aug 8 06:59:10 totoro postgres[28158]: [2-4] #011 WHERE NOT superseded AND vote != -1
Aug 8 06:59:10 totoro postgres[28158]: [2-5] #011 AND cast(privs AS bit(10)) & 2::bit(10) = 0::bit(10)
Aug 8 06:59:10 totoro postgres[28158]: [2-6] #011 GROUP BY editor, editor.name
Aug 8 06:59:10 totoro postgres[28158]: [2-7] #011 ORDER BY count(vote.id) DESC, musicbrainz_collate(editor.name)
Aug 8 06:59:10 totoro postgres[28158]: [2-8] #011 LIMIT 25
As the job of a cache is simply to speed things up, but not be the primary source, this solution will not work, and we need to investigate either speeding these queries up, or storing the results. It may be good enough to simply calculate these stats once a day and add the to our statistics table.
- is duplicated by
-
MBS-5053 502 Bad Gateway when trying to view editor statistics
- Closed