using OR predicate is faster?

Posts   
 
    
Stranger
User
Posts: 23
Joined: 22-Nov-2005
# Posted on: 04-Dec-2005 11:14:09   

I want to fetch some entities with some given IDs.

I can use prdicare expression and also use FetchEntity for each ID.

which one is faster?

for example i want to fecth Order entities with IDs of 1, 2, ..., 10.

I can use this manner :

FetchEntity(new Order(1)); FetchEntity(new Order(2)); ... FetchEntity(new Order(10));

and also i can use this :

PredicateExpression with predicates of

(ID = 1) OR (ID = 2) OR ... OR (ID = 10)

which one is faster?

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 04-Dec-2005 23:03:48   

FieldCompareRangePredicate with a FetchEntityCollection is the fastest.

FieldBetweenPredicate will be better if you want all the IDs between 1 & 10, otherwise use FieldCompareRangePredicate

Stranger
User
Posts: 23
Joined: 22-Nov-2005
# Posted on: 05-Dec-2005 07:46:19   

thanks alot

that works simple_smile