From 2bf970eb06cd969244406fde1738a0e5c9188fe2 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 11 Aug 2025 09:09:40 -0400 Subject: [PATCH] convert to materialized view --- tables/lastpricedetail.pg.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tables/lastpricedetail.pg.sql b/tables/lastpricedetail.pg.sql index db2337f..cbb6d7c 100644 --- a/tables/lastpricedetail.pg.sql +++ b/tables/lastpricedetail.pg.sql @@ -1,4 +1,6 @@ -CREATE TABLE pricequote.lastpricedetail AS +DROP TABLE pricequote.lastpricedetail + +CREATE MATERIALIZED VIEW pricequote.lastpricedetail AS WITH base AS ( SELECT customer, @@ -122,3 +124,5 @@ FULL OUTER JOIN seg_json s WITH DATA; --SELECT * FROM pricequote.lastpricedetail; + +CREATE INDEX lastpricedetail_idx ON pricequote.lastpricedetail(customer, partgroup); \ No newline at end of file