Add necessary indexes to replication queue
Currently the replication_queue
has two indexes:
"replication_queue_pkey" PRIMARY KEY, btree (id)
"virtual_target_on_replication_queue_idx" btree ((job ->> 'virtual_storage'::text), (job ->> 'target_node_storage'::text))
The Dequeue seems to filter by some columns which are not indexed
state
lock_id
Not having these indexed potentially forces more rows to be checked. With !2457 (merged) in place, I guess the impact will be smaller as we would not have a lot of records to shift through in any case.
cc @zj-gitlab