Skip to content

Commit 06ce0a8

Browse files
committed
add WHERE time_deleted IS NULL to ereport indices
1 parent d9f8019 commit 06ce0a8

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

schema/crdb/dbinit.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5791,7 +5791,9 @@ ON omicron.public.sp_ereport (
57915791
sp_type,
57925792
sp_slot,
57935793
time_collected
5794-
);
5794+
)
5795+
where
5796+
time_deleted IS NULL;
57955797

57965798
CREATE INDEX IF NOT EXISTS order_sp_ereports_by_timestamp
57975799
ON omicron.public.sp_ereport
@@ -5833,7 +5835,9 @@ CREATE INDEX IF NOT EXISTS lookup_host_ereports_by_sled
58335835
ON omicron.public.host_ereport (
58345836
sled_id,
58355837
time_collected
5836-
);
5838+
)
5839+
WHERE
5840+
time_deleted IS NULL;
58375841

58385842
CREATE INDEX IF NOT EXISTS order_host_ereports_by_timestamp
58395843
ON omicron.public.host_ereport

schema/crdb/ereports/up02.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ ON omicron.public.sp_ereport (
33
sp_type,
44
sp_slot,
55
time_collected
6-
);
6+
)
7+
WHERE
8+
time_deleted IS NULL;

schema/crdb/ereports/up06.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
CREATE INDEX IF NOT EXISTS lookup_host_ereports_by_sled ON omicron.public.host_ereport (
22
sled_id,
33
time_collected
4-
);
4+
)
5+
WHERE
6+
time_deleted IS NULL;

0 commit comments

Comments
 (0)