We use LLBLGEN Pro 4.2 Final and .Net 4.5.2
We issue a count on a IQuerable<JourneyEntity>
or a getDbCount on JourneyCollection
The following query is executed
SELECT COUNT(*) AS NumberOfRows FROM (SELECT * FROM journey) TmpResult
which takes 319.5 Seconds! to execute.
When i use GetScalar on selfservicing code
EntityFields fields = new EntityFields(1);
fields[0] = EntityFieldFactory.Create(JourneyFieldIndex.Id);
fields[0].AggregateFunctionToApply = AggregateFunction.Count;
JourneyDAO dao = new JourneyDAO();
return (int)dao.GetScalar(fields, null, null,null, null);
the desired query is executed
SELECT COUNT(`journey`.`Id`) AS `Id` FROM `journey` LIMIT 1
which takes 20.4 Seconds to execute
is there a way to use the faster way on a IQueryable.Count();