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

Bulk get items with a single database query

XMLWordPrintable

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

      In some endpoints, such as the bulk low level get (https://github.com/metabrainz/acousticbrainz-server/blob/f9afa4017c49b7d412b6557b68744d8fbbb2da07/webserver/views/api/v1/core.py#L188) we get many items by performing a database query for as many things as we want. While we do have a limit on the number of items that can be requested at once, we still make many queries to the database to retrieve these items.

      It's possible that we can retrieve these items all at once, using a window function to count the offset.

      We should do a test to see if, on a large database, the time taken to perform a more complex query to get many items is faster than one query for each item in the request.

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

              Created:
              Updated:
              Resolved:

                Version Package