beetbox / beetbox/beets

Improve performance of random

Open
#1,795 1 comment 1 reaction 0 assignees View on GitHub
feature
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

Currently, the plugin generates the full query, then samples it in Python.
I suspect it would be faster to randomly sort the query in SQL, and LIMIT it to the number requested.

https://stackoverflow.com/questions/1253561/sqlite-order-by-rand

Contributor guide

Open the contributing guide

Research direction

The issue concerns the plugin's Python query generation and SQLite result sampling. Start by locating where the plugin generates the full query and samples it in Python, then compare that path with SQLite random ordering and LIMIT behavior. Done means the requested number of random results is limited in SQL while preserving existing behavior and improving performance.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlite
Domain
database, performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.