Open Bug 1047818 Opened 10 years ago Updated 1 year ago

Avoid large IN clauses

Categories

(Toolkit :: Places, defect, P3)

defect

Tracking

()

People

(Reporter: mak, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: perf, Whiteboard: [snt-scrubbed][places-performance])

we have some large IN clauses, they are very unefficient and cause of jank
we could either implement array binding in Storage or use temp tables.
As far as I can tell, there is no function for array binding in sqlite3, right?

Also, I don't see how a temporary table would be faster than a large IN clause (assuming that the IN row is indexed).
there is array binding, we didn't implement it. it's in a separate extension though, so it wouldn't work with out support of system sqlite.

we can ask support if they improved IN, btw, just the fact you might have a giant string to parse is a perf issue by itself.
or we can ask to put array binding in the core product.
I believe that having array binding would be good even without performance concern, just for the sake of safety, so I would vote for getting array binding. I have no clear opinion on whether it should be in the core product or we should adopt an extension.
Blocks: PlacesJank
Priority: -- → P3
Keywords: perf
Depends on: 483318
Severity: normal → S3

We should first fix bug 483318.
We can also use the Slow SQL telemetry to measure how common slow queries are using large IN clauses, and determine a priority for this work.

Whiteboard: [snt-scrubbed][places-performance]
You need to log in before you can comment on or make changes to this bug.