Table is big, has indexes and in a good state.
How can i set to the framework to use LIMIT at all?

21 марта 2012 г. 10:47 пользователь Johann Werner <[email protected]> написал:

> Hi Ron,
>
> looking at the code of ERXFetchSpecificationBatchIterator the first time
> you call batchWithIndex all primary keys are fetched so that when you call
> either batchWitchIndex, batchWithRange or nextBatch the select statement
> that is sent to the DB will qualify the objects by pk IN (pk1, pk2, ...)
> that's why you don't see a LIMIT statement.
> How big is you Artist table? Which fetch is running too long, the one
> fetching the pks or that getting the real objects? Is your DB in a good
> state, do you have an index on your pk column?
>
> jw
>
>
> Am 21.03.2012 um 08:29 schrieb Ron X:
>
> > hi everybody!
> > i have real trouble with ERXFetchSpecificationBatchIterator
> >
> >             EOQualifier qualifier =
> ERXQ.and(clazz.availabilityQuialifier, qualifierForLetter(letter));
> >             EOFetchSpecification fs = new
> EOFetchSpecification(Artist.ENTITY_NAME, qualifier, Artist.NAME.ascs());
> >             if (pagination != null)    {
> >                 ERXFetchSpecificationBatchIterator batchSpec = new
> ERXFetchSpecificationBatchIterator(fs);
> >                 batchSpec.setBatchSize(10);
> >                 NSArray<Artist> array = batchSpec.batchWithIndex(new
> Integer(pagination));
> > ...
> > and than - i have statement running too long exception!
> > i see that this batch DO NOT do LIMIT at the end of query!
> > so i have 10 elements in array, but the request to DB (MySQL) is
> incredible!
> >
> > how can i fix this - to set the real LIMIT at the end of query?
>
>
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to