After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759587 - Refactor Tracker queries
Refactor Tracker queries
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks:
 
 
Reported: 2015-12-17 12:54 UTC by Felipe Borges
Modified: 2016-01-03 18:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
configure: Depend on Tracker >= 1.7.1 (916 bytes, patch)
2015-12-31 19:09 UTC, Carlos Garnacho
committed Details | Review
query: Rework albums query (6.51 KB, patch)
2015-12-31 19:09 UTC, Carlos Garnacho
committed Details | Review
query: Rework songs query (2.98 KB, patch)
2015-12-31 19:09 UTC, Carlos Garnacho
committed Details | Review
query: Rework song count query (1.60 KB, patch)
2015-12-31 19:09 UTC, Carlos Garnacho
committed Details | Review
query: Rework artists query (7.11 KB, patch)
2015-12-31 19:09 UTC, Carlos Garnacho
committed Details | Review
query: Rework "songs for album" query (1.87 KB, patch)
2015-12-31 19:09 UTC, Carlos Garnacho
committed Details | Review
query: rework playlists query (1.77 KB, patch)
2015-12-31 19:09 UTC, Carlos Garnacho
committed Details | Review
query: rework search subqueries (14.98 KB, patch)
2015-12-31 19:09 UTC, Carlos Garnacho
committed Details | Review
query: Use sparql 1.1 syntax on order_by_statement() (1.30 KB, patch)
2015-12-31 19:09 UTC, Carlos Garnacho
committed Details | Review

Description Felipe Borges 2015-12-17 12:54:59 UTC
As pointed out at https://bugzilla.gnome.org/show_bug.cgi?id=739924#c7
Comment 1 Carlos Garnacho 2015-12-31 19:09:18 UTC
Created attachment 318091 [details] [review]
configure: Depend on Tracker >= 1.7.1

This is the first version providing all the sparql 1.1 features
we'll be using in the following patches.
Comment 2 Carlos Garnacho 2015-12-31 19:09:23 UTC
Created attachment 318092 [details] [review]
query: Rework albums query

The query can be greatly simplified if done as a song query grouped
by album. The several tracker:uri-is-descendant() can be then done
at once in the main query, and the tracker:uri-is-descendant calls
themselves have been replaced with pure string checks, which will
yield better performance over large sets.
Comment 3 Carlos Garnacho 2015-12-31 19:09:28 UTC
Created attachment 318093 [details] [review]
query: Rework songs query

No large functional changes, the path matching is performed using
pure string operations though. The filters for the music pieces
not being videos or playlists has been removed too. If that happens,
it is plainly a Tracker bug, no need to tap over it.
Comment 4 Carlos Garnacho 2015-12-31 19:09:32 UTC
Created attachment 318094 [details] [review]
query: Rework song count query

No large functional changes, the path matching is performed using
pure string operations though. The filters for the music pieces
not being videos or playlists has been removed too. If that happens,
it is plainly a Tracker bug, no need to tap over it.
Comment 5 Carlos Garnacho 2015-12-31 19:09:37 UTC
Created attachment 318095 [details] [review]
query: Rework artists query

Similarly to the albums query, this query turns out simpler by
doing it as a query grouped by album. The same simplifications
apply.
Comment 6 Carlos Garnacho 2015-12-31 19:09:42 UTC
Created attachment 318096 [details] [review]
query: Rework "songs for album" query

No large functional changes, the path matching is performed using
pure string operations though. The filters for the music pieces
not being videos or playlists has been removed too. If that happens,
it is plainly a Tracker bug, no need to tap over it.
Comment 7 Carlos Garnacho 2015-12-31 19:09:47 UTC
Created attachment 318097 [details] [review]
query: rework playlists query

No need to deep nest filters and optionals, it can all be done in
the main query.
Comment 8 Carlos Garnacho 2015-12-31 19:09:52 UTC
Created attachment 318098 [details] [review]
query: rework search subqueries

The artist/album/song match subgraphs/subqueries can be greatly
simplified using FTS. However the "any" match would be better
performed as the union of 3 different selects, so we'd need to
perform an outer query modification instead of an inner one.

Despite keeping the "any" match largely the same, use sparql1.1
to reduce/improve verbosity.
Comment 9 Carlos Garnacho 2015-12-31 19:09:57 UTC
Created attachment 318099 [details] [review]
query: Use sparql 1.1 syntax on order_by_statement()

We now implicitly rely on the given term to be lower cased, because
it's now preemptively lowercased in the places calling this function.
Comment 10 Felipe Borges 2016-01-03 17:36:43 UTC
Review of attachment 318091 [details] [review]:

sure.
Comment 11 Felipe Borges 2016-01-03 17:37:24 UTC
Review of attachment 318092 [details] [review]:

sure.
Comment 12 Felipe Borges 2016-01-03 17:38:05 UTC
Review of attachment 318093 [details] [review]:

sure.
Comment 13 Felipe Borges 2016-01-03 17:38:31 UTC
Review of attachment 318094 [details] [review]:

sure.
Comment 14 Felipe Borges 2016-01-03 17:38:52 UTC
Review of attachment 318095 [details] [review]:

sure.
Comment 15 Felipe Borges 2016-01-03 17:39:20 UTC
Review of attachment 318096 [details] [review]:

sure!
Comment 16 Felipe Borges 2016-01-03 17:39:44 UTC
Review of attachment 318097 [details] [review]:

sure.
Comment 17 Felipe Borges 2016-01-03 17:40:02 UTC
Review of attachment 318098 [details] [review]:

sure.
Comment 18 Felipe Borges 2016-01-03 17:40:24 UTC
Review of attachment 318099 [details] [review]:

sure!
Comment 19 Carlos Garnacho 2016-01-03 18:29:08 UTC
Thanks!

Attachment 318091 [details] pushed as 5bc67ac - configure: Depend on Tracker >= 1.7.1
Attachment 318092 [details] pushed as 0d28004 - query: Rework albums query
Attachment 318093 [details] pushed as 571f219 - query: Rework songs query
Attachment 318094 [details] pushed as 04fbd8a - query: Rework song count query
Attachment 318095 [details] pushed as cf4acf6 - query: Rework artists query
Attachment 318096 [details] pushed as 5a81196 - query: Rework "songs for album" query
Attachment 318097 [details] pushed as 120b275 - query: rework playlists query
Attachment 318098 [details] pushed as 0b169a9 - query: rework search subqueries
Attachment 318099 [details] pushed as 7eff30a - query: Use sparql 1.1 syntax on order_by_statement()