zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #02025
[Bug 650930] Re: Make timestamp related queries faster
** Attachment added: "search_application_test.py"
https://bugs.edge.launchpad.net/bugs/650930/+attachment/1652420/+files/search_application_test.py
** Changed in: zeitgeist
Status: New => In Progress
** Changed in: zeitgeist
Assignee: (unassigned) => Markus Korn (thekorn)
--
Make timestamp related queries faster
https://bugs.launchpad.net/bugs/650930
You received this bug notification because you are a member of Zeitgeist
Framework Team, which is subscribed to Zeitgeist Framework.
Status in Zeitgeist Framework: In Progress
Bug description:
When grep'ing the source of `unity-place-applications` and `unity-place-files` you will find out that these two products are using the FindEvents method, and both products are using this method to query for the complete time interval [0, sys.maxint] (aka. TimeRange.always()). And I've seen similar queries in other clients too. So I think it is worth trying to optimize the query for this kind of queries.
The attached script is timing the exactly same query which is used in `unity-place-applications` on a database which contains 50k events, with 100 randomly choosen different actors.
On lp:zeitgeist the find_events query returns the 6 events with most popular actors in ~0.22s
---> MostPopularActor: get len(ids)=6 using .find_eventids() in 0.224661s
By making the sql queries on the timestamp column conditional we will be able to reduce this time to
---> MostPopularActor: get len(ids)=6 using .find_eventids() in 0.069161s
References