Question Ba Moser · Aug 25, 2020

I use these example classes:
Class Sample.Address Extends (%SerialObject, %Populate)
{Property Street As %String;
Property City As %String;
Property State As %String(POPSPEC = "USState()");
Property Zip As %String;}
Class Sample.Person1 Extends (%Persistent%Populate)
{  Property Name As %String;
Property Home As Sample.Address;
Property AR As array Of Sample.Address; }

In SQL it is Table Sample.Person1

No problem to define INDEX on Home_State

But Table Sample.Person1_AR

HowTo define an INDEX on AR_State ?
Index st On AR.State;

Does not compile!

12
0 716
Question Ba Moser · Aug 23, 2020

I try to compare classic JOIN against implicit JOIN.

It is a simple case. But I am surprised.

The class:
Class Sample.Person1 Extends (%Persistent, %Populate)
{  Property Name As %String;
Property Home As Sample.Address;
Property AR As array Of Sample.Address; }

Query #1 - classic:
select name,home_state,a.* from sample.person1 p
join sample.person1_AR a on p.Id=a.person1
and home_state=AR_state

Query #2 - implicit
select person1->name,person1->home_state,*
from sample.person1_AR where person1->home_state=AR_state

for both I have the same query plan:

2
0 252