Faster Sync Cycles: Database Index on landlord_links
Faster Sync Cycles: Database Index on landlord_links
Release: v1.0.219 Category: Performance / Database
Overview
Version 1.0.219 ships a targeted database performance improvement that speeds up every sync cycle across the platform. A composite index has been added to the landlord_links table on the columns (org_id, sync_enabled), directly addressing a query hotspot in the background sync infrastructure.
Background
The platform uses Inngest to orchestrate background sync functions — these functions are responsible for importing landlord transactions from the AgentOS API and keeping financial records up to date for Making Tax Digital submissions.
On every sync cycle, Inngest functions query the landlord_links table to find all active integrations for a given organisation:
SELECT *
FROM landlord_links
WHERE org_id = $1
AND sync_enabled = true;
Prior to this release, there was no database index covering org_id and sync_enabled together. As the number of landlord link records grows, this query was resolved via a sequential scan, increasing latency and placing unnecessary load on the database.
What Changed
A composite index was added:
CREATE INDEX idx_landlord_links_org_id_sync_enabled
ON landlord_links (org_id, sync_enabled);
This index is a direct match for the query pattern used by Inngest sync functions — the database engine can now perform an efficient index seek rather than scanning the entire table.
Impact
| Area | Before | After |
|---|---|---|
| Sync query execution | Full/partial table scan | Index seek |
| Database CPU during sync | Higher at scale | Reduced |
| Sync cycle latency | Degrades with record growth | Consistently fast |
| Application code changes | — | None required |
Who Is Affected
This improvement is transparent to all users and requires no action. All organisations using AgentOS transaction sync will benefit automatically from faster, more consistent sync cycle performance.
Notes
- This is a purely additive schema change — no data is modified and no downtime is required.
- The improvement compounds with scale: the more landlord link records an organisation has, the greater the relative performance gain.