Do not retrieve mtime from database repeatedly when sorting
ClosedPublic

Authored by bruns on Mar 31 2018, 4:01 AM.

Details

Summary

For larger result sets, querying the mtime (once for lhs and rhs each)
on each sorting step contributes significantly to the execution time.
Retrieve the mtime once for each document and use it for searching.

Test Plan
$> build/bin/baloosearch -l 1 type=image
/home/stefan/DE15_Connector_Pinout.svg
Elapsed: 0.432438 msecs

$> baloosearch -l 1 type=image
/home/stefan/DE15_Connector_Pinout.svg
Elapsed: 3.66243 msecs

$> build/bin/baloosearch  type=image | wc -l
Elapsed: 3.19816 msecs
1017

$> baloosearch  type=image | wc -l
Elapsed: 7.45712 msecs
1017

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Mar 31 2018, 4:01 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptMar 31 2018, 4:01 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
bruns requested review of this revision.Mar 31 2018, 4:01 AM
bruns edited the summary of this revision. (Show Details)Mar 31 2018, 4:03 AM
bruns edited the test plan for this revision. (Show Details)
bruns added a reviewer: Baloo.
bruns updated this revision to Diff 31007.Mar 31 2018, 4:09 AM
  • Do not retrieve document ID for skipped result entries
michaelh requested changes to this revision.Mar 31 2018, 8:16 AM
michaelh added a subscriber: michaelh.

Specially with --limit this is a considerable speed gain. Thank you.

src/lib/searchstore.cpp
123

Please use braces.

This revision now requires changes to proceed.Mar 31 2018, 8:16 AM
bruns updated this revision to Diff 31162.Apr 2 2018, 5:33 PM

Drop unrelated commit squashed by arc ...

bruns marked an inline comment as done.Apr 2 2018, 5:34 PM
bruns added inline comments.
src/lib/searchstore.cpp
123

Hunk omitted, as unrelated

michaelh accepted this revision.Apr 2 2018, 8:19 PM
This revision is now accepted and ready to land.Apr 2 2018, 8:19 PM
This revision was automatically updated to reflect the committed changes.
bruns marked an inline comment as done.