Feature #5453
optimize FindQuery hasOne and hasAny implementations
0%
Related issues
History
#1 Updated by Eric Faulhaber almost 3 years ago
We currently convert standalone CAN-FIND calls to use FindQuery.hasAny
or FindQuery.hasOne
. These methods will fetch the entire record and hydrate a DMO in order to answer the question of whether a record exists, then throw that DMO away. Under the right conditions, we should be able to skip the fetch and just perform a projection query (i.e., primary key only), which would be faster.
This will require some refactoring of RAQ.execute
and RAQ.executeImpl
. Complications to consider w.r.t. "the right conditions":
- the fast-find cache;
- the dirty database.
#2 Updated by Ovidiu Maxiniuc almost 3 years ago
Alternatively, we can keep the record in session cache, hoping a future query will have the result already fetched. Usually, the hasXXX()
queries are used before issuing a bigger/more resource consuming query. If the query is not issued, the record is dropped, as per cache policy.
#3 Updated by Alexandru Lungu over 1 year ago
- Related to Feature #7076: make CAN-FIND avoid hydration added