Unnecessary slow query including `with id`
Created by: Henrik tom Wörden
In a database with roughly 300k entities, I observed, that a query of the type FIND <RECORDTYPE> WHICH REFERENCES <ID> WITH id=<ID>
takes quite long (1.5s). Both s are the same. And the result set is 0. The query without the with
, i.e. FIND <RECORDTYPE> WHICH REFERENCES <ID>
is very fast and also has no results.
Naively, one would have expected that the condition with id=xyz
is applied to the result set of the first part and, as that one is small or empty, should not have an impact.
Imported comments:
By Timm Fitschen on 2021-02-17T13:58:01.725Z
mentioned in merge request !78
By Henrik tom Wörden on 2020-11-09T07:51:27.284Z
changed title from Unnecessary slow query including with id to Unnecessary slow query including {+with id
+}