Commit Graph

2 Commits

Author SHA1 Message Date
Aaron Son c5d08aacd3 go: sqle/statspro: Make it so ANALYZE TABLE does not go through rate limiting on the SerialQueue.
This lets it run faster and at a speed independent of stats timer configuration.
2025-05-28 16:06:50 -07:00
Aaron Son a90a4bca07 go: sqle/statspro: prollyStats: FlushFromMem: Fix long-held lock when flushing stats to disk.
For sql-server instances with many databases, many branches or many tables
indexes, flushing stats could cause queries to block until stats were finished
flushing. StatsController attempted to rate limited how much I/O bandwidth
would be used to flush stats, but this is currently counter-productive because
all queries are blocked from analyzing successfully until stats are flushed.

This changes it back to flush stats to disk as quickly as possible when we need
to do it. Computing stats is already rate limited, so for large flushes this
should not happen to often.

We will continue to improve things here so that stats writes have less impact
on server resource utilization and do not block user-facing work as they
proceed.
2025-05-20 15:42:57 -07:00