Note: There are a few cases of duplicates in user autocompletion which are being worked on.

satchel is performing inefficient queries for autocomplete results

RESOLVED FIXED in mozilla21

Status

()

Toolkit
Form Manager
RESOLVED FIXED
8 years ago
5 years ago

People

(Reporter: Dolske, Assigned: MattN)

Tracking

Trunk
mozilla21
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
Debug builds give console warnings when populating the form history autocomplete dropdown. This is because we have an index on the "value" column, but the query is doing "ORDER BY UPPER(value)". MattN says we should be able to add an index for UPPER(value), which would fix this. Adding "/* do not warn (bug ###)*/" to the query will suppress the warning in the meantime, if we want to.
(Reporter)

Updated

8 years ago
Summary: satchel is performing inefficient queries → satchel is performing inefficient queries for autocomplete results
It turns out that SQLite does not support function-based indexes like I had thought.  We are changing the query in bug 370117 and bug 446247 making it more complex which will make it even harder to index.
Is this still relevant? Should we just add the warning removal comment? Or did this get addressed by those other bugs?
Created attachment 703135 [details] [diff] [review]
v.1 Simple patch to silence warning

(In reply to :Gavin Sharp (away Jan 16-23) from comment #2)
> Is this still relevant? Should we just add the warning removal comment? Or did 
> this get addressed by those other bugs?

The query changed but we are still doing an ORDER BY on the result of function calls[1].  There haven't been any reports of slow form history in the 3.5 years since the more complex query landed and there is caching in JS for narrowing down existing results so I think we can silence this warning. I also did performance benchmarks in 2009 and the results were acceptable at the time.

AFAICT, SQLite still doesn't support function-based indexes.

[1] https://mxr.mozilla.org/mozilla-central/source/toolkit/components/satchel/nsFormAutoComplete.js?rev=5ce71981e005#255
Assignee: nobody → mnoorenberghe+bmo
Status: NEW → ASSIGNED
Attachment #703135 - Flags: review?(dolske)
(Reporter)

Updated

5 years ago
Attachment #703135 - Flags: review?(dolske) → review+
Thanks.

https://hg.mozilla.org/integration/fx-team/rev/7d49dd8c58dd
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/7d49dd8c58dd
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.