Using the subj_origin column of event_view is slower than it should be
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zeitgeist Framework |
Fix Released
|
Undecided
|
Markus Korn |
Bug Description
Let me summarize what we have wrt subj_origin
1) we have a subj_origin column in the event table, which is an integer pointing to an entry in the uri table
2) we have an index on the subj_origin column of the event table
3) we have subj_origin in event view, which is not the id, but the resolved uri
4) we have subj_origin_id in event_view which is in fact the same as event.subj_uri, but we get this value by using a sub-query on the uri table.
Points 3) and 4) are the reason why the index on event.subj_origin is never used when querying the event_view, example:
DEBUG:zeitgeist
QUERY:
SELECT id FROM event_view WHERE subj_origin_id=1 ([])
PLAN:
[0, 0, u'TABLE event']
[0, 0, u'TABLE uri USING PRIMARY KEY']
By simply renaming "event_
Related branches
- Siegfried Gevatter: Approve
- Seif Lotfy: Approve
- Mikkel Kamstrup Erlandsen: Pending requested
-
Diff: 123 lines (+32/-16)5 files modified_zeitgeist/engine/__init__.py (+1/-1)
_zeitgeist/engine/main.py (+9/-5)
_zeitgeist/engine/sql.py (+9/-8)
_zeitgeist/engine/upgrades/core_2_3.py (+11/-0)
test/sql-test.py (+2/-2)
Changed in zeitgeist: | |
status: | New → Triaged |
Changed in zeitgeist: | |
assignee: | nobody → Markus Korn (thekorn) |
status: | Triaged → In Progress |
Changed in zeitgeist: | |
milestone: | none → 0.7.0 |
Changed in zeitgeist: | |
status: | In Progress → Fix Committed |
Changed in zeitgeist: | |
status: | Fix Committed → Fix Released |