Skip to content

Commit

Permalink
fix: Adjusting primary-key order for SQL Server to reduce deadlocking (
Browse files Browse the repository at this point in the history
…#570)

Adjusting primary-key order for SQL Server to reduce deadlocking after
analysis and testing presented in #527


## Fixes

#527


## Reminders
- [x] Added/ran automated tests
- [x] Update README and/or examples
- [x] Ran `mvn spotless:apply`
  • Loading branch information
kagkarlsson authored Dec 12, 2024
1 parent 710fca1 commit 72624d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db-scheduler/src/test/resources/mssql_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ create table scheduled_tasks
last_heartbeat datetimeoffset,
[version] bigint not null,
priority smallint,
primary key (task_name, task_instance),
primary key (task_instance, task_name),
index execution_time_idx (execution_time),
index last_heartbeat_idx (last_heartbeat),
index priority_execution_time_idx (priority desc, execution_time asc)
Expand Down

0 comments on commit 72624d8

Please sign in to comment.