internal/target: sort public_id descending
The previous sort would run the risk of missing items which collide on update or create times because of the compound comparison using strictly less than for both the timestamp and the public_id. Sorting both descending avoids thi issue.
This commit is contained in:
1 parent
3bf925ca32
commit
fc9b26efa7
2 files changed
+10
-10
No files matched your search
@@ -36,9 +36,9 @@ begin;
|
||||
|
||||
-- Add new indexes for the update time queries.
|
||||
create index target_create_time_public_id_idx
|
||||
on target (create_time desc, public_id asc);
|
||||
on target (create_time desc, public_id desc);
|
||||
create index target_update_time_public_id_idx
|
||||
on target (update_time desc, public_id asc);
|
||||
on target (update_time desc, public_id desc);
|
||||
|
||||
analyze target;
|
||||
|
||||
|
||||
Reference in new issue
Block a user