Faster smart edits by hitting annotation_annotation_layer index #2832
Labels
No labels
backend
critical
defect
duplicate
enhancement
fixed
frontend
general
invalid
major
minor
normal
oxjs
pandora_client
python-ox
task
trivial
wontfix
worksforme
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: 0x2620/pandora#2832
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For smart edits whose query matches annotations on relatively small layers (ie, not subtitles!), postgres will use the layer index to good effect if given the chance. But the way the query is built right now ends up producing
upper(layer) = upper('foo')
which can't use the (case-sensitive) index. The case-insensitivity is redundant for layer names, so here's a patch.(With 400 such public smart edits, this patch makes the difference between being able to load the list of edits or the request timing out!)
Attachment 0001-ClipManager.filter_annotations-fix-opterator-typo.patch (915 bytes) added
Attachment 0002-ClipManager-match-annotation-layer-case-sensitively.patch (2011 bytes) added
(Actually for some queries on edits you can sometimes do even better by moving the
item_id in (...)
clause toannotation_annotation
rather thanclip_clip
and adding an index onannotation_annotation (item_id, layer)
but it's a bit fiddly to get the query to come out that way. One for another time.)In [pandora,5022]changeset:"pandora,5022":