Beetstream icon indicating copy to clipboard operation
Beetstream copied to clipboard

AlbumList view query is very slow

Open gryphonmyers opened this issue 2 years ago • 5 comments

The AlbumList view is quite slow to render, stemming from the fact that the handler pulls ALL albums out of the Beets DB then does pagination in memory. For large libraries, it is very noticeable how slow this is - trying to navigate a paginated view takes forever.

Solution - we can't do pagination using built-in Beets queries, but we can should be able to use lib.transaction to perform our own SQLite query. Instead of paginating in memory we would paginate with built-in sqlite limits and offsets.

gryphonmyers avatar Jun 16 '23 06:06 gryphonmyers

Yes, I totally agree. I took some shortcut to have a working version but this is the kind of optimization I need to do next.

BinaryBrain avatar Jun 25 '23 10:06 BinaryBrain

If I can find some time I am also willing to contribute

gryphonmyers avatar Jun 25 '23 23:06 gryphonmyers