SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Slow query log

Open joshua-spacetime opened this issue 10 months ago • 0 comments

I'd like each database to have a slow query log in the form of a system table. We should log ad hoc queries submitted via the cli as well as subscription and subscription update queries. Each entry should include:

  1. The sql text
  2. The sender identity
  3. The time it was executed
  4. Metrics such as rows scanned, bytes scanned, index seeks, etc.
  5. The physical plan that was executed (requires that we have some textual plan representation)
  6. The energy cost of the plan

Constraints/Requirements:

  1. The logging level should be configurable
  2. It should be possible to truncate the log
  3. The log does not have to be consistent - writes to the log can be delayed/batched together

joshua-spacetime avatar Mar 11 '25 23:03 joshua-spacetime