SalesSheet.ai — Gmail Sync (After)
Optimized Gmail Sync Architecture
1
history.list — Fetch only changes since last sync
Returns 2-5 changes instead of re-fetching 100 messages
120ms
2
messages.get x 3 — Fetch only new messages
Only fetch content for messages that actually changed
340ms
3
Batch upsert — Single database write
INSERT ... ON CONFLICT with multiple value tuples in one query
15ms
Total Sync Time
0.7 seconds
Typical incremental sync with 2-5 new messages
0.7ms per query
FAST
67x faster 47s → 0.7s for typical sync cycle