Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I solved my own problem. This is just a reminder for anyone who might run into similar issues. <strong>The error I made was not creating indexes for the required fields on the database side.</strong> I just clicked the "indexed" option in my model in XCode. Apparently this DOES NOT create any indexes, if you have supplied the .sqlite file yourself.</p> <p>After a curious launch case, where Core Data decided to create the database for me, I saw these SQL sentences executed:</p> <pre><code>2011-10-08 19:49:40.572 App[1717:307] CoreData: sql: CREATE INDEX ZINFO_ZREGISTERED_NAME_INDEX ON ZINFO (ZREGISTERED_NAME) 2011-10-08 19:49:40.586 App[1717:307] CoreData: sql: CREATE INDEX ZINFO_ZFIRSTLETTER_INDEX ON ZINFO (ZFIRSTLETTER) 2011-10-08 19:49:40.598 App[1717:307] CoreData: sql: CREATE INDEX ZINFO_ZNAME_INDEX ON ZINFO (ZNAME) 2011-10-08 19:49:40.610 App[1717:307] CoreData: sql: CREATE INDEX ZINFO_ZN_SL_NAME_INDEX ON ZINFO (ZN_SL_NAME) 2011-10-08 19:49:40.622 App[1717:307] CoreData: sql: CREATE INDEX ZINFO_ZN_REGISTERED_NAME_INDEX ON ZINFO (ZN_REGISTERED_NAME) 2011-10-08 19:49:40.635 App[1717:307] CoreData: sql: CREATE INDEX ZINFO_ZDETAILS_INDEX ON ZINFO (ZDETAILS) </code></pre> <p>After I replicated these indexes on my own database, things have sped up considerably:</p> <pre><code>CoreData: sql: SELECT 0, t0.Z_PK FROM ZINFO t0 ORDER BY t0.ZREGISTERED_NAME CoreData: annotation: sql connection fetch time: 0.1315s CoreData: annotation: total fetch execution time: 0.1568s for 4161 rows. </code></pre> <p>I'm extremely happy with these numbers. But since I've now presorted my database, I can use a number for NSSortDescriptor. This brings me down to:</p> <pre><code>CoreData: sql: SELECT 0, t0.Z_PK FROM ZINFO t0 ORDER BY t0.ZID CoreData: annotation: sql connection fetch time: 0.0677s CoreData: annotation: total fetch execution time: 0.0890s for 4161 rows. </code></pre> <p>So a little under 9 hundredths of a second, down from 9 tenths of a second.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload