From 53b5cf75b5779236554b15c3684318276e009b7c Mon Sep 17 00:00:00 2001 From: Prachi Mishra Date: Mon, 12 Dec 2022 13:01:50 -0800 Subject: [PATCH] adding NULLS LAST in desc index on lineage_events.created_at Signed-off-by: Prachi Mishra --- .../db/migration/V54__lineage_events_created_at_indexed.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/resources/marquez/db/migration/V54__lineage_events_created_at_indexed.sql b/api/src/main/resources/marquez/db/migration/V54__lineage_events_created_at_indexed.sql index d9c7208014..cd085feb5d 100644 --- a/api/src/main/resources/marquez/db/migration/V54__lineage_events_created_at_indexed.sql +++ b/api/src/main/resources/marquez/db/migration/V54__lineage_events_created_at_indexed.sql @@ -1,7 +1,7 @@ -- new column will be created with 'null' filled for existing rows ALTER TABLE lineage_events ADD created_at TIMESTAMP WITH TIME ZONE; -create index lineage_events_created_at_index on lineage_events (created_at desc); +create index lineage_events_created_at_index on lineage_events (created_at desc NULLS LAST); -- The new default set to UTC now() will only apply in subsequent INSERT or UPDATE commands; it does not cause rows already in the table to change. ALTER TABLE lineage_events ALTER COLUMN created_at SET DEFAULT (now() AT TIME ZONE 'UTC')::timestamptz; \ No newline at end of file