# iOS SQLiteNormalizedCache cold start can be slower than reloading data from backend

**URL:** <https://community.apollographql.com/t/ios-sqlitenormalizedcache-cold-start-can-be-slower-than-reloading-data-from-backend/9344>\
**Category:** Client SDKs\
**Tags:** ios, caching\
**Created:** [August 5, 2025, 3:14pm UTC](https://community.apollographql.com/t/ios-sqlitenormalizedcache-cold-start-can-be-slower-than-reloading-data-from-backend/9344 "2025-08-05T15:14:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh\_josh\_josh](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/josh_josh_josh/32/6023_2.png) [@josh\_josh\_josh](https://community.apollographql.com/u/josh_josh_josh)\
**Post date:** [August 5, 2025, 3:14pm UTC](https://community.apollographql.com/t/ios-sqlitenormalizedcache-cold-start-can-be-slower-than-reloading-data-from-backend/9344/1 "2025-08-05T15:14:19Z")

</div>

I have a simple query that loads a list of Visa card transactions. I’m currently testing with a large list of 4922 `TransactionFragment`s. (Queries & Fragments shown at bottom of this post).

As you can see from the following table: cold start queries from SQLiteNormalizedCache are an order of magnitude slower than doing a requery, and \*\*CAN EVEN BE SLOWER THAN LOADING FRESH FROM THE BACKEND.  
\*\*  
How do I fix this? I need to instantly run this query when the app opens (it’s the first thing the user sees) so I can’t preload.

**TIMING**

- Fresh load from backend (AWS, Node, Postgres): 4-8 seconds
- Cold start load from SQLiteNormalizedCache: **6 seconds**
- Requery (after cold start) from SQLiteNormalizedCache: 0.95 seconds
- Query from InMemoryNormalizedCache: 0.72 seconds

I added **`return`** ` ` **`try`** `? CacheKeyInfo(jsonValue: object["id"])` to my `SchemaConfiguration` and that changed nothing.

`query Transactions($updatedSince: String) {`  
` transactions(updatedSince: $updatedSince) {`  
` endCursor`  
` hasNext`  
` totalTransactions`  
` transactions {`  
` …TransactionFragment`  
` }`  
` }`  
`}`

type `TransactionFragment` {  
id: ID!  
createdAt: String!  
updatedAt: String!  
deletedAt: String  
transactionType: TransactionType!  
transactionStatus: TransactionStatus  
declineReason: String  
actionRanAssignToEnvelopes: Boolean!  
actionRanSendNotification: Boolean!  
name: String!  
nameOriginal: String  
amount: Int!  
merchantId: String  
mcc: String  
cardId: String  
cardLast4: String  
notes: String  
checkId: String  
checkDepositError: CheckDepositError  
addressCity: String  
addressState: String  
addressZip: String  
addressCountry: String  
addressLine1: String  
addressLine2: String  
locationLat: String  
locationLong: String  
locationUnstructured: String  
merchantLogo: String  
merchantPhone: String  
merchantWebsite: String  
fundedByTransactionId: ID  
toEnvelopeId: ID  
fromEnvelopeId: ID  
}

---

<div class="post-metadata">

**Author:** ![ZachF-Apollo](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/zachf-apollo/32/4210_2.png) [@ZachF-Apollo](https://community.apollographql.com/u/ZachF-Apollo)\
**Post date:** [August 6, 2025, 1:34am UTC](https://community.apollographql.com/t/ios-sqlitenormalizedcache-cold-start-can-be-slower-than-reloading-data-from-backend/9344/2 "2025-08-06T01:34:06Z")

</div>

@josh_josh_josh I have been starting work on a pretty big caching overhaul we are planning to do, although even for the current caching setup I don’t think 5,000 entries should be taking multiple seconds even on cold start. I am going to look back through our current caching code and see if anything stands out performance wise for SQLite, may not be possible but if you could provide a sample project that recreates this with mock data it would make it much easier to try and track down a potential issue.

---

<div class="post-metadata">

**Author:** ![ZachF-Apollo](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/zachf-apollo/32/4210_2.png) [@ZachF-Apollo](https://community.apollographql.com/u/ZachF-Apollo)\
**Post date:** [August 6, 2025, 5:53pm UTC](https://community.apollographql.com/t/ios-sqlitenormalizedcache-cold-start-can-be-slower-than-reloading-data-from-backend/9344/3 "2025-08-06T17:53:48Z")

</div>

@josh_josh_josh I have a PR up to do some batching of select queries as a general performance improvement, it’s possible this may help with your issue if you are willing to point your code to the PR branch and give it a try I’d love to hear the results. [Adding batching to sqlite selects by BobaFetters · Pull Request #725 · apollographql/apollo-ios-dev · GitHub](https://github.com/apollographql/apollo-ios-dev/pull/725)

---

<div class="post-metadata">

**Author:** ![josh\_josh\_josh](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/josh_josh_josh/32/6023_2.png) [@josh\_josh\_josh](https://community.apollographql.com/u/josh_josh_josh)\
**Post date:** [August 23, 2025, 7:17am UTC](https://community.apollographql.com/t/ios-sqlitenormalizedcache-cold-start-can-be-slower-than-reloading-data-from-backend/9344/4 "2025-08-23T07:17:22Z")

</div>

@ZachF-Apollo I got a chance to test your commit today and it basically has no effect. The fromCache load time isn’t any better or worse for my specific query 🤷‍♂️

So sorry, but I’m running a solo engineering org over here so I don’t have the bandwidth to reproduce in a standalone project. Totally get how that would help. I figured out a workaround to load the most recent 200 records first and trick my users into thinking app startup is loading faster than it actually is so I’m running with that for now. Happy to test more one-off branches if you ever need. Including if you want to breadcrumb one with tons of print statement timestamps or something.

---

<div class="post-metadata">

**Author:** ![josh\_josh\_josh](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/josh_josh_josh/32/6023_2.png) [@josh\_josh\_josh](https://community.apollographql.com/u/josh_josh_josh)\
**Post date:** [June 9, 2026, 8:47pm UTC](https://community.apollographql.com/t/ios-sqlitenormalizedcache-cold-start-can-be-slower-than-reloading-data-from-backend/9344/5 "2026-06-09T20:47:10Z")

</div>

@ZachF-Apollo  
I updated to Apollo iOS 2.1.2 and the loading is worse now.

5000 records takes 9+ seconds. It’s an issue to show a 9 second loading screen when my app starts up every time.

---

<div class="post-metadata">

**Author:** ![AndersonFord37](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@AndersonFord37](https://community.apollographql.com/u/AndersonFord37)\
**Post date:** [August 2, 2026, 8:23pm UTC](https://community.apollographql.com/t/ios-sqlitenormalizedcache-cold-start-can-be-slower-than-reloading-data-from-backend/9344/6 "2026-08-02T20:23:31Z")

</div>

Cold start from SQLiteNormalizedCache is rough because it has to denormalize and deserialize everything upfront. Since your backend cold load is only a couple seconds slower, and your requery is nearly instant anyway, might be worth just skipping the cache entirely on app open and fetching fresh from backend instead. At least then the user sees real data coming in rather than waiting the same amount of time for the cache to churn.
