grafana/pkg/services/sqlstore
Matthew Jacobson e45f664ca4
Alerting: Replace index role_id, action, scope with action, scope, role_id on permission table (#80336)
* Alerting: Add action, scope, role_id to permission table

The existing role_id, action, scope index has the wrong ordering to be most
effectively used in dashboard/folder permission requests.

On a large tests set, the slow database calls were on the order of ~30-40ms, so
when performed individually they don't have that large of a latency impact.
However, when done in bulk in the migration this adds up to some very slow
requests.

After the index is added these same database calls are reduced to ~4-5ms

* Change index to action, scope, role_id

* Make new index unique and drop [role_id, action, scope] index
2024-01-24 16:18:14 -05:00
..
migrations Alerting: Replace index role_id, action, scope with action, scope, role_id on permission table (#80336) 2024-01-24 16:18:14 -05:00
migrator Give dialects control over how insert and update queries are performed (#79946) 2024-01-11 19:55:45 +01:00
permissions Remove folderid service test (#80433) 2024-01-12 16:43:39 +01:00
searchstore RBAC: Change annotation filter to use dashboard based annotation scopes (#78635) 2023-11-29 05:34:44 -05:00
session Chore: add/update sqlstore-related helper functions (#77408) 2023-11-03 10:30:52 -04:00
sqlutil Chore: remove xorm from preference (#53803) 2022-08-17 22:07:20 -04:00
bulk_test.go Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
bulk.go Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
database_config_test.go Chore: Extract DatabaseConfig parsing from SQLStore (#81157) 2024-01-24 16:49:49 +01:00
database_config.go Chore: Extract DatabaseConfig parsing from SQLStore (#81157) 2024-01-24 16:49:49 +01:00
database_wrapper.go Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
logger.go Chore: add/update sqlstore-related helper functions (#77408) 2023-11-03 10:30:52 -04:00
session_test.go SQLStore: Fix SQLite error propagation if query retries are disabled (#64904) 2023-03-17 12:57:13 +02:00
session.go Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
sqlstore_metrics_test.go Metrics: Fixed grafana_database_conn_* metrics, and added new go_sql_stats_* metrics as eventual replacement (#54405) 2022-08-31 08:54:32 -04:00
sqlstore_metrics.go Metrics: Fixed grafana_database_conn_* metrics, and added new go_sql_stats_* metrics as eventual replacement (#54405) 2022-08-31 08:54:32 -04:00
sqlstore_test.go Chore: Extract DatabaseConfig parsing from SQLStore (#81157) 2024-01-24 16:49:49 +01:00
sqlstore.go Chore: Extract DatabaseConfig parsing from SQLStore (#81157) 2024-01-24 16:49:49 +01:00
tls_mysql.go Chore: Extract DatabaseConfig parsing from SQLStore (#81157) 2024-01-24 16:49:49 +01:00
transactions_test.go SQLStore: Add test for nested transactions events (#60500) 2023-01-23 14:17:56 +01:00
transactions.go SQLStore: Add test for nested transactions events (#60500) 2023-01-23 14:17:56 +01:00
user_test.go Bug(sqlstore): fix issue with postgres unable to find existing main organization (#73789) 2023-08-30 11:45:20 -04:00
user.go Bug(sqlstore): fix issue with postgres unable to find existing main organization (#73789) 2023-08-30 11:45:20 -04:00