Can Core Data avoid index rebuild when adding a new attribute during lightweight migration?

8 hours ago 1
ARTICLE AD BOX

I’m investigating Core Data lightweight migration behavior with SQLite and ran into a performance issue.

Scenario:

Model V1: EntityA has one fetchIndex

Model V2: EntityA adds a new optional attribute timestamp (Integer 64), with no changes to existing attributes or fetchIndex definitions

From a SQLite perspective, this change should be handled by a simple:

ALTER TABLE ZENTITYA ADD COLUMN ZTIMESTAMP INTEGER

But I observe that Core Data rebuilds the existing index, which becomes a significant performance issue for large databases.

CoreData: sql: DROP INDEX IF EXISTS Z_EntityA_id CoreData: sql: ALTER TABLE ZENTITYA ADD COLUMN ZTIMESTAMP INTEGER CoreData: sql: CREATE INDEX IF NOT EXISTS Z_EntityA_byID ON ZENTITYA

Question:

Is there any way to avoid or bypass index rebuilding for this kind of schema changes?

I found a related question but it doesn’t have an answer:
Core data add new column without rebuild indexing

Read Entire Article