Uploaded image for project: 'AcousticBrainz'
  1. AcousticBrainz
  2. AB-406

Add column representing submission offset

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      We allow duplicate submissions, and retrieve them with a combination of mbid and offset. We currently compute this offset by ordering all items by submission date, and applying an SQL offset/limit.
      This means that every time we get a lowlevel or highlevel item, we have to perform a sort in the query to get the offset, which we believe is using a lot of processing power.

      Instead, we want to compute the offset once at submission time, and make all queries that include an offset just select this value. This will also make some queries such as bulk-get much simpler (and will mean that we don't need AB-394)

      We should do this in a few steps:

      • Migration to add the field, nullable
      • Migration to add the offset for all existing submissions
      • Stop submissions, and add offset for all missing items
      • Release change that computes offset on submission
      • Migration, remove nullable, add index
      • Release change that uses offset to select items

        Attachments

          Activity

            People

            • Assignee:
              aidanlw17 Aidan Lawford-Wickham
              Reporter:
              alastairp Alastair Porter
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package