Re: Fetch Specs and Limits
Re: Fetch Specs and Limits
- Subject: Re: Fetch Specs and Limits
- From: Robert Walker <email@hidden>
- Date: Wed, 11 May 2005 20:19:09 -0400
Greg,
You are correct. EOF does not support a starting index for fetch
limits (as far as I can tell). Possibly due to the need for broad
support for SQL servers that may not support the feature (not sure).
Here's my suggestion: Fetch using EOUtilities.rawRowsForSQL(...) so
you can do your fetch limits in the SQL statement. Then promote the
raw rows to full EOs as needed. You might even think about leaving
them in raw rows and displaying them to the user directly from the
dictionaries. This would be a bit more work, but less memory hungry
than full EOs.
Another possibility is that you could add a row number to your table
that auto increments. Then use it in a WHERE clause to fetch the
range you want. Raw rows is probably better, but this would support
databases that may not support a starting index in their SQL fetch
limit.
On May 11, 2005, at 6:57 PM, Greg wrote:
After reading the previous thread on OutOfMemoryExceptions when
dealing with large data sets getting fetched. I was looking at
optimising my search results component to be more effecient.
Currently because there is on about 8000 records to search at the
moment, it is not really an issue, but with the system growing it
will become one in the future.
I was looking at EOFetchSpecification on how to fetch only a
certain number of results. It has the setFetchLimit method, but it
doesn't have a setStartAtIndex or something similar. What I am
wanting to do is just to fetch the results of the search for say
the first 20 records. If there is 200 records then there will be 10
pages of results, when the user clicks to see the second page of
results, I would want to make a fetch spec to return the results
starting at index 21 and limit it to 20 results. I cannot see how I
can do this. Do I need to write the SQL to do it?
Any information is greatly appreciated.
Regards,
Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden