On 2010 Feb 13, at 13:51, daniele malcom wrote:

> Hi Roland, in fact indices table exists (for DDArticle entity):
> Enter SQL statements terminated with a ";"
> sqlite> .tables
> ZDDARTICLE    Z_METADATA    Z_PRIMARYKEY
> sqlite> .indices ZDDARTICLE
> ZDDARTICLE_ZMESSAGEID_INDEX
> ZDDARTICLE_ZPARENT_INDEX
> 
> With my macbook pro insertion of 30k articles took about 2/3 minutes.
> I've uploaded a test project:
> http://dl.dropbox.com/u/103260/CoreDataTreeTest.zip
> I really don't know why it should take this long time but using
> Instruments the big part is obviously fetch for searching id and
> parent.

Sorry, I've not downloaded your project yet.

If you're using garbage collection, ignore this.  If not, in your previous 
code, I noticed there was a memory leak in using -newArticleWithID:.

Another silly idea, just for fun, would be to create that predicate in code.  I 
just don't like -predicateWithFormat:.  Something like this (untested code):

NSExpression* lhs = [NSExpression expressionForKeyPath:@"messageid"] ;
NSExpression* rhs = [NSExpression expressionForConstantValue:_msgid];
NSPredicate *predicate ; 
predicate = [NSComparisonPredicate predicateWithLeftExpression:lhs
                                               rightExpression:rhs
                                                      
modifier:NSDirectPredicateModifier
                                                          
type:NSEqualToPredicateOperatorType
                                                       options:0] ;

For some real evil, run that query using the sqlite command-line program and 
see how long it takes :0

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to