polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tibor Mlynarik <tibor.mlyna...@gmail.com>
Subject Re: JOOQ EntityStore
Date Mon, 19 Jun 2017 09:21:40 GMT
Hi Niclas,

your correction put me in doubt if I understand db model correctly. 

What happens to ENTITIES._value_id and related TestEntity*._identity when entity updates ?
It has to be updated to new value across all 3 tables, right ? ( and such value has to be
globally unique)

	Tibor



> On Jun 11, 2017, at 7:24 AM, Niclas Hedhman <niclas@hedhman.org> wrote:
> 
> On Sun, Jun 11, 2017 at 11:41 AM, Niclas Hedhman <niclas@hedhman.org> wrote:
>> 
>> Composite get() results in 2 queries, one for properties/assocs and one
> for the _ASSOCS tables.
>> 
>> select *
>>    from "POLYGENE"."ENTITIES"
>>    left outer join "POLYGENE"."TestEntity" on "_value_id" =
> "TestEntity"."_identity"
>>    where "ENTITIES"."_identity" = 'ca22d692-5461-4756-8316-5a214d055aa5'
>> 
>> select *
>>    from "POLYGENE"."ENTITIES"
>>    join "POLYGENE"."TestEntity_ASSOCS" on "_value_id" =
> "TestEntity_ASSOCS"."_identity"
>>    where "ENTITIES"."_identity" = 'ca22d692-5461-4756-8316-5a214d055aa5'
>> 
>> In each of those queries, there is a "join" line per Mixin type, so
> highly composed
> 
> CORRECTION; There is an additional query for the ENTITIES table itself, to
> obtain the "_value_id". This might also be more cached than currently is,
> as it is fetched quite often.
> 
> 
> 
> Cheers
> --
> Niclas Hedhman, Software Developer
> http://polygene.apache.org - New Energy for Java


Mime
View raw message