Bug 1023663 - use fts in the sparql query for a faster reply
use fts in the sparql query for a faster reply
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: bijiben (Show other bugs)
20
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Pierre-Yves Luyten
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-26 14:18 EDT by Fabrice Bellet
Modified: 2015-06-29 08:44 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-06-29 08:44:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
full text search sparql query (825 bytes, patch)
2013-10-26 14:18 EDT, Fabrice Bellet
no flags Details | Diff

  None (edit)
Description Fabrice Bellet 2013-10-26 14:18:02 EDT
Created attachment 816431 [details]
full text search sparql query

Hi!

I tested bijiben-3.10.1 from koji, that fixed the in-notes search capability, but I noticed that the sparql query is now much much slower than it used to be, so I suggest to come back to full text search query if possible (fts is case insensitive, and is also faster). proposed patch attached.
Comment 1 Pierre-Yves Luyten 2013-10-26 18:05:38 EDT
Thanks Fabrice.

Upstream I did switched from fts:match to fn:contains because of missing results - see https://bugzilla.gnome.org/show_bug.cgi?id=699656.

That said, feel free to provide more material since I did not look up fts internals neither did benchmark anything.
Comment 2 Fabrice Bellet 2013-10-26 18:56:09 EDT
I'm not a sparql expert, but here is some more information about my use case:

[bellet@bonobo ~]$ find .local/share/bijiben/ | wc -l
90
[bellet@bonobo ~]$ du -sh .local/share/bijiben/
364K	.local/share/bijiben/
[bellet@bonobo ~]$ du -sh .local/share/tracker .cache/tracker/
18M	.local/share/tracker
182M	.cache/tracker/
[bellet@bonobo ~]$ time tracker-sparql -q "SELECT ?urn WHERE { ?urn a nfo:Note; nie:title ?title ; nie:plainTextContent ?content  . FILTER (fn:contains (fn:lower-case (?content), 'arret' ) || fn:contains (fn:lower-case (?title), 'arret' ))}"
Results:
  urn:uuid:649b3a74-058a-2fa6-d51f-6d3b52557672


real	0m2.662s
user	0m2.581s
sys	0m0.070s
[bellet@bonobo ~]$ time tracker-sparql -q "SELECT ?urn WHERE { ?urn a nfo:Note; nie:title ?title ; nie:plainTextContent ?content  . FILTER (fn:contains ((?content), 'arret' ) || fn:contains ((?title), 'arret' ))}"
Results:
  urn:uuid:649b3a74-058a-2fa6-d51f-6d3b52557672


real 	0m0.438s
user	0m0.381s
sys	0m0.050s
[bellet@bonobo ~]$ time tracker-sparql -q "SELECT ?urn WHERE { ?urn a nfo:Note; nie:title ?title ; fts:match 'arret' }"
Results:
  urn:uuid:649b3a74-058a-2fa6-d51f-6d3b52557672


real	0m0.047s
user	0m0.029s
sys	0m0.011s

It seems that the lowercase conversion is also relatively costly, but definitely using fts:match really provides the fastest results. About the gnome bugzilla reports, in my experience, the current sparql query from version 3.10.1 modified to use fts:match reports matches for both notes title and content.
Comment 3 Fabrice Bellet 2013-10-26 18:59:39 EDT
... and partial result still works.
Comment 4 Fedora End Of Life 2015-05-29 05:38:25 EDT
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Fedora End Of Life 2015-06-29 08:44:06 EDT
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.