-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: batch SQL stats flush #67867
Copy link
Copy link
Closed
Labels
A-sql-observabilityRelated to observability of the SQL layerRelated to observability of the SQL layerC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Metadata
Metadata
Assignees
Labels
A-sql-observabilityRelated to observability of the SQL layerRelated to observability of the SQL layerC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
The initial implementation for SQL Stats flush logic performs as follow:
INSERT ... ON CONFLICT DO NOTHINGstatement for each stats object.statisticscolumn from the conflicting row and update it with new stats usingSELECT ... FOR UPDATEstatementUPDATEstatement to update the rows.Note that for the fast path, we are performing 1 network round trip, and for slow path, we are performing 3 network round trip.
We can amortize this by batch multiple stats object into a single requests and improve the throughput.
Jira issue: CRDB-8749