         
         let initialItems = fetchedItems
         databaseWriter.writeForIssue117 { db in
-            if compareItems == nil {
-                compareItems = compareItemsFactory(db)
-            }
-            
-            let fetchAndNotifyChanges = makeFetchAndNotifyChangesFunction(controller: self, fetchAlongside: fetchAlongside, compareItems: compareItems!, recordsWillChange: recordsWillChange, tableViewEvent: tableViewEvent, recordsDidChange: recordsDidChange)
+            if identicalItems == nil {
+                identicalItems = identicalItemsFactory(db)
+            }
+            
+            let fetchAndNotifyChanges = makeFetchAndNotifyChangesFunction(controller: self, fetchAlongside: fetchAlongside, identicalItems: identicalItems!, recordsWillChange: recordsWillChange, tableViewEvent: tableViewEvent, recordsDidChange: recordsDidChange)
 
             let (statement, _) = try! request.prepare(db)
             let observer = FetchedRecordsObserver(readInfo: statement.readInfo, fetchAndNotifyChanges: fetchAndNotifyChanges)

    ///         same identity. For example, they have the same id.
    public convenience init(_ databaseWriter: DatabaseWriter, request: FetchRequest, queue: DispatchQueue = .main, isSameRecord: ((Record, Record) -> Bool)? = nil) {
        if let isSameRecord = isSameRecord {
            self.init(databaseWriter, request: request, queue: queue, compareItemsFactory: { _ in { isSameRecord($0.record, $1.record) } })
        } else {
            self.init(databaseWriter, request: request, queue: queue, compareItemsFactory: { _ in { _ in false } })
        }
    }
    
    fileprivate init(_ databaseWriter: DatabaseWriter, request: FetchRequest, queue: DispatchQueue, compareItemsFactory: @escaping (Database) -> (Item<Record>, Item<Record>) -> Bool) {
        self.request = request
        self.databaseWriter = databaseWriter
        self.compareItemsFactory = compareItemsFactory
        self.queue = queue
    }
    #else

                assert(fetchedItems != nil)
                assert(fetchedAlongside != nil)
                
                // Return if observer has been invalidated
                guard let strongObserver = observer else { return }
                guard strongObserver.isValid else { return }
                
                // Return if fetched records controller has been deallocated
                guard let callbackQueue = controller?.queue else { return }
                
                // Return if there is no change
                if identicalItemArrays(fetchedItems, strongObserver.items) { return }
                
                // Ready for next check
                strongObserver.items = fetchedItems
                
                callbackQueue.async {
                    // Return if observer has been invalidated
                    guard let strongObserver = observer else { return }
                    guard strongObserver.isValid else { return }
                    
                    // Now we can retain controller
                    guard let strongController = controller else { return }
                    
                    // Notify changes
                    recordsWillChange?(strongController, fetchedAlongside)
                    strongController.fetchedItems = fetchedItems
                    recordsDidChange?(strongController, fetchedAlongside)
                }
            }
        }
    }
#endif

fileprivate func identicalItemArrays<Record>(_ lhs: [Item<Record>], _ rhs: [Item<Record>]) -> Bool {
    guard lhs.count == rhs.count else {
        return false
    }
    for (lhs, rhs) in zip(lhs, rhs) {
        if lhs.row != rhs.row {
            return false
        }
    }
    return true
}


// MARK: - UITableView Support

#if os(iOS)
    fileprivate typealias ItemComparator<Record: RowConvertible> = (Item<Record>, Item<Record>) -> Bool
    
    extension FetchedRecordsController {
        
        // MARK: - Accessing Records
