Database Reference
In-Depth Information
You've cut the time of the initial fetch down to almost a third of the original, and
the subsequent fetches are much smaller and faster. Congratulations, you have
increased the speed of your app again!
Advanced fetching
Fetch requests use predicates to limit the amount of data returned. As mentioned
above, for optimal performance, you should limit the amount of data you fetch to
the minimum needed: the more data you fetch, the longer the fetch will take.
Fetch Predicate Performance
When performing fetches, you should limit the amount of data returned to the
minimum needed. You can limit your fetch requests by using predicates.
If your fetch request requires a compound predicate, you can make it more
efficient by putting the more restrictive predicate first. If your predicate
contains string comparisons, this is especially true.
For example, a predicate with a format of "(active == YES) AND (name
CONTAINS[cd] %@)" would likely be more efficient than "(name CONTAINS[cd]
%@) AND (active == YES)" .
Please consult Apple's Predicate Programming Guide for more predicate
performance optimizations.
Build and run Employee Directory, and select the second tab labeled Departments .
This tab shows a listing of departments and the number of employees in each
department. Tapping a department cell takes the user to a list of the employees in
the selected department.
Search WWH ::




Custom Search