Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow query log per module #1159

Open
joshua-spacetime opened this issue Apr 25, 2024 · 2 comments
Open

Slow query log per module #1159

joshua-spacetime opened this issue Apr 25, 2024 · 2 comments
Assignees

Comments

@joshua-spacetime
Copy link
Collaborator

joshua-spacetime commented Apr 25, 2024

#1071 captures slow queries through the SpacetimeDB server logs. Now we should give users the same insight with a slow query system table. They should be able to configure the 3 thresholds (subscriptions, ad hoc, incremental update) in the same way we can do now.

Something worth noting is that queries are executed in read-only transactions, but writing to a table requires a mutable transaction. This may require making read-only transactions upgradable. Basically the opposite direction of #1157.

@joshua-spacetime joshua-spacetime self-assigned this Apr 25, 2024
@joshua-spacetime
Copy link
Collaborator Author

The schema of the slow query log

Name Type Description
query string text of the slow query
workload enum subscription, incremental update, ad hoc
duration u64 duration of the query in milliseconds
identity Identity calling identity for this query

@cloutiertyler
Copy link
Contributor

Upgrading to mutable is problematic because mutable queries require tracking reads, and you can't retroactively track reads that you've already read, so you always have to track reads for readers even if they are never upgraded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants