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

Add column representing submission offset

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None
    • None

      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

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

              Created:
              Updated:
              Resolved:

                Version Package