Re: Core Data: different fetch performance when launching app [SOLVED]
Re: Core Data: different fetch performance when launching app [SOLVED]
- Subject: Re: Core Data: different fetch performance when launching app [SOLVED]
- From: Jakob Olesen <email@hidden>
- Date: Sat, 14 Oct 2006 16:25:00 +0200
On 14/10/2006, at 15.45, Diederik Hoogenboom wrote:
Thanks! Your last remark did the trick. I just added parentItem ==
nil to the predicate of the arraycontroller and the fetch now take
0.156 seconds the first time.
Lucky guess ;-)
I would have expected that Z_ENT would be indexed. It's one of the
primary columns that are always there. Is there a way to add an
index to a table in the SQLLite store, other then creating an
relationship?
No.
You can go behind Core Data's back and add the index yourself using
the sqlite3 command line tool or the SQLite API, but I wouldn't
recommend that.
Z_ENT is a low cardinality attribute. It only takes a few distinct
values across your 30,000 records. Such attributes normally don't
benefit from being indexed, and each index has a performance penalty
when inserting records. That is probably why Core Data doesn't index
that attribute.
It would be a nice addition to Core Data to be able to add indices.
Currently, every fetch that doesn't use a relationship or an object
ID causes a full table scan.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden