Project

General

Profile

Feature #5453

optimize FindQuery hasOne and hasAny implementations

Added by Eric Faulhaber almost 3 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
version:

Related issues

Related to Database - Feature #7076: make CAN-FIND avoid hydration Closed

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

Also available in: Atom PDF