Project

General

Profile

Feature #7076

make CAN-FIND avoid hydration

Added by Greg Shah over 1 year ago. Updated 6 months ago.

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

100%

billable:
No
vendor_id:
GCD
version:

Related issues

Related to Database - Feature #5453: optimize FindQuery hasOne and hasAny implementations New
Related to Database - Bug #7174: Resolve simple CAN-FIND statements faster Test

History

#1 Updated by Greg Shah over 1 year ago

I assume we already do this, but just in case, does CAN-FIND avoid hydration?

#2 Updated by Eric Faulhaber over 1 year ago

It does, if we implement it as a sub-select (i.e., when it is a nested CAN-FIND in another query's WHERE clause).

It does not avoid hydration as a standalone FindQuery. Not hydrating a DMO is a relatively recent topic of discussion. Currently (until we implement #6720), every query (without a FIELDS/EXCEPT clause) which resolves to a record fully hydrates. Once #6720 is implemented, we will get this for free, but I think we can do even better by altering the conversion of a standalone CAN-FIND to either be:

  • (for CAN-FIND(...)): a projection query returning only the record's primary key;
  • (for CAN-FIND(FIRST/LAST ...)): an exists query.

This is similar to the approach we use for the sub-selects, when CAN-FIND is nested. There is no need to bring back the DMO's data at all in these cases.

#3 Updated by Greg Shah over 1 year ago

  • Tracker changed from Support to Feature

Let's go for the quick win.

#4 Updated by Greg Shah over 1 year ago

  • Subject changed from does CAN-FIND avoid hydration? to make CAN-FIND avoid hydration

#5 Updated by Alexandru Lungu over 1 year ago

  • Related to Feature #5453: optimize FindQuery hasOne and hasAny implementations added

#6 Updated by Alexandru Lungu over 1 year ago

I found Ovidiu's comment in #5453-2 relevant for this task.

#7 Updated by Alexandru Lungu about 1 year ago

  • Related to Bug #7174: Resolve simple CAN-FIND statements faster added

#8 Updated by Alexandru Lungu about 1 year ago

  • Assignee set to Dănuț Filimon
  • Status changed from New to WIP

Danut, please investigate this.
I am not sure if CAN-FIND still hydrates in the latest versions of FWD-H2 trunk (>14550).
Make some examples with stand-alone CAN-FIND (i.e. IF CAN-FIND) and nested CAN-FIND (FOR EACH tt WHERE CAN-FIND (tt2 WHERE ..)). AFAIK, for the nested one you've worked on the conversion with "exists" that didn't hydrate.

#9 Updated by Dănuț Filimon about 1 year ago

I've tested both temporary and persistent tables with CAN-FIND and nested CAN-FIND. CAN-FIND no longer hydrates with trunk/rev.14552. My examples consisted of using CAN-FIND with FIRST, LAST or no keyword.

#10 Updated by Alexandru Lungu 12 months ago

  • Status changed from WIP to Review
  • % Done changed from 0 to 100

I guess this can be rejected now?

Eric, AFAIK you are handling lazy hydration. CAN-FIND doesn't do any kind of hydration now (goes with SELECT 0), so it won't necessarily be optimized by lazy hydration. We can close this.

#11 Updated by Alexandru Lungu 11 months ago

  • Status changed from Review to Test

#12 Updated by Eric Faulhaber 6 months ago

  • Status changed from Test to Closed

Also available in: Atom PDF