I need to do some union and intersect between multiple relational predicate bucket.
for example of intersect.
select * from (select x, y from a join b on a.id = b.id where b.name = "XXX") as c inner join (select x,y from a join b on a.id = b.id where b.name="YYY") as d inner join (select x,y from a join b on a.id = b.id where b.name="zzz") ....(the subquery is dynamically generated, it could be 5 or 10 of them)
each subquery will have a relational predicate bucket. can I do it? Do I need the dynamicRelation? if it is possible, I guess the performace would be better.
The other way, I fingered is to return each (select x, y from a join b on a.id = b.id where b.name = "XXX") as entity and use entity level function(union and intersect)
for example
IEnumerable<MyEntity> entity1 returned by FetchEntityCollection for (select x, y from a join b on a.id = b.id where b.name = "XXX")
IEnumerable<MyEntity> entity2 returned by FetchEntityCollection for (select x, y from a join b on a.id = b.id where b.name = "XXX")
final = entity1.Intersect(entity2);
I will use the loop to go through each of them to get the final result, but I guess performance will be bad.
Which way is better, do we have something better than these in LLBLGen?
Thanks a lot