Comments (7)
sqlite> explain query plan SELECT uri, name FROM albums AS album WHERE 'local:artist:md5:e47bef4136ddcf1174824b46725a9a94' IN (SELECT album.artist_uri UNION SELECT artists FROM track WHERE album = album.uri);
0|0|0|SCAN TABLE album
0|1|1|SEARCH TABLE artist USING INDEX sqlite_autoindex_artist_1 (uri=?)
0|0|0|EXECUTE CORRELATED LIST SUBQUERY 1
3|0|0|SEARCH TABLE track USING INDEX track_album_index (album=?)
1|0|0|COMPOUND SUBQUERIES 2 AND 3 USING TEMP B-TREE (UNION)
from mopidy-local-sqlite.
sqlite> explain query plan SELECT uri, name FROM albums AS album WHERE 'local:artist:md5:e47bef4136ddcf1174824b46725a9a94' IN (SELECT artists FROM track WHERE album = album.uri) OR album.artist_uri = 'local:artist:md5:e47bef4136ddcf1174824b46725a9a94';
0|0|0|SCAN TABLE album
0|1|1|SEARCH TABLE artist USING INDEX sqlite_autoindex_artist_1 (uri=?)
0|0|0|EXECUTE CORRELATED LIST SUBQUERY 1
1|0|0|SEARCH TABLE track USING INDEX track_album_index (album=?)
from mopidy-local-sqlite.
sqlite> explain query plan SELECT uri, name FROM tracks WHERE album_uri IS NULL AND 'local:artist:md5:e47bef4136ddcf1174824b46725a9a94' IN (artist_uri, albumartist_uri) ORDER BY name;
0|0|0|SCAN TABLE track USING INDEX track_name_index
0|1|1|SEARCH TABLE album USING INDEX sqlite_autoindex_album_1 (uri=?)
0|2|2|SEARCH TABLE artist USING INDEX sqlite_autoindex_artist_1 (uri=?)
0|3|3|SEARCH TABLE artist AS composer USING INDEX sqlite_autoindex_artist_1 (uri=?)
0|4|4|SEARCH TABLE artist AS performer USING INDEX sqlite_autoindex_artist_1 (uri=?)
0|5|5|SEARCH TABLE artist AS albumartist USING INDEX sqlite_autoindex_artist_1 (uri=?)
0|0|0|EXECUTE LIST SUBQUERY 1
from mopidy-local-sqlite.
sqlite> explain query plan SELECT uri, name FROM track WHERE album IS NULL AND artists = 'local:artist:md5:e47bef4136ddcf1174824b46725a9a94' ORDER BY name;
0|0|0|SEARCH TABLE track USING INDEX track_artists_index (artists=?)
0|0|0|USE TEMP B-TREE FOR ORDER BY
from mopidy-local-sqlite.
The SCAN TABLE track
is probably responsible for this, while the SCAN TABLE album
probably accounts for ca. 10% of the total run time (given albums have ca. 10 tracks, each).
from mopidy-local-sqlite.
sqlite> explain query plan SELECT 'album' AS type, album.uri AS uri, album.name AS name FROM album JOIN track ON album.uri = track.album WHERE ? in (track.artists, album.artists) GROUP BY album UNION SELECT 'track' AS type, uri, name FROM track WHERE artists = ? AND album IS NULL ORDER BY type, name;
1|0|0|SCAN TABLE album (~439 rows)
1|1|1|SEARCH TABLE track USING INDEX track_album_index (album=?) (~6 rows)
1|0|0|EXECUTE LIST SUBQUERY 2
1|0|0|USE TEMP B-TREE FOR GROUP BY
1|0|0|USE TEMP B-TREE FOR ORDER BY
2|0|0|SEARCH TABLE track USING INDEX track_artists_index (artists=?) (~2 rows)
2|0|0|USE TEMP B-TREE FOR ORDER BY
0|0|0|COMPOUND SUBQUERIES 1 AND 2 (UNION)
from mopidy-local-sqlite.
"The UNION operator works the same way as UNION ALL, except that duplicate rows are removed from the final result set."
from mopidy-local-sqlite.
Related Issues (20)
- Directories showing up empty after successful scan HOT 2
- Add mopidy-local-sqlite to mopidy's coveralls.io configuration HOT 2
- Remove "Folders" directory browsing
- Create develop branch and make it the default HOT 1
- Remove Mopidy <1.1 workarounds
- library.db stored in /var/lib/mopidy instead of "data_dir" path HOT 5
- Duplicate Albums with Same Name HOT 5
- [Question] MusicBrainz MBID HOT 2
- ERROR Local library sqlite not found when running Mopidy as a service HOT 10
- Timeout accessing the database HOT 2
- Sort Last Month's Updates by age HOT 1
- ImportError: No module named utils HOT 3
- Show original local file structure in musicbox-webclient HOT 1
- Curious Album duplicity? HOT 7
- I cant see any artists or albums in MPDroid HOT 7
- Are more complicated directories possible? HOT 2
- Where is the database saved? HOT 3
- Can multiple Mopidy access the same database? HOT 2
- Auto rescan HOT 1
- Archive mopidy-local-sqlite once mopidy-local has been released HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mopidy-local-sqlite.