Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-5111

Editor statistics data regularly falls out of cache, and cannot be recomputed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2012-10-01
    • 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.

            ianmcorvidae Ian McEwen
            acid2 Oliver Charles
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2012-10-01