asset_face, stack and workflow were the only tables with an updateId
column but no index on it. Face and stack sync (AssetFacesV1/V2,
StacksV1, PartnerStacksV1) filter and order on updateId, so every mobile
sync seq-scanned every face on the instance and walked all of the user's
(or partners') stacks, even when nothing had changed. workflow isn't
synced; it gets the index for consistency.
Incremental sync with nothing changed, PG 14:
| query | before | after |
| ---------------------------------- | -------- | -------- |
| assetFace.getUpserts (425k faces) | 33-37 ms | 0.15 ms |
| stack.getUpserts (6k stacks) | 0.8 ms | 0.004 ms |
| partnerStack.getUpserts (6k) | 0.6 ms | 0.007 ms |
The face scan grows with the instance's face count (~10x that at 4M
faces); the stack one with the user's stack count.
(cherry picked from commit 9df807ed4a9536a28dad463270082095ec1fe94d)