From 3af3dcebb085de4afef6d7381b574149f8e90ccc Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Mon, 25 Mar 2024 14:43:56 +0700 Subject: add refresh materialized view --- import_brand.ktr | 58 +++++++++++++----- refresh_materialized_view.ktr | 135 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 176 insertions(+), 17 deletions(-) diff --git a/import_brand.ktr b/import_brand.ktr index d006f22..b9273c5 100644 --- a/import_brand.ktr +++ b/import_brand.ktr @@ -436,14 +436,14 @@ - dw bi indoteknik + dw bi indoteknik (localhost) localhost POSTGRESQL Native dw_bi_indoteknik - 5703 - metabase - Encrypted 2be98dfba28d7bf86853c9f58cfc4f889 + 5432 + odoo + Encrypted 2be98afc82bdfd8dd9a2ca45acc83f6c3 @@ -462,7 +462,7 @@ PORT_NUMBER - 5703 + 5432 PRESERVE_RESERVED_WORD_CASE @@ -478,7 +478,7 @@ SUPPORTS_TIMESTAMP_DATA_TYPE - Y + N USE_POOLING @@ -487,12 +487,12 @@ - erp indoteknik production - localhost + erp indoteknik production (localhost) + 10.148.0.3 POSTGRESQL Native erp_indoteknik - 5901 + 5432 odoo Encrypted 2be98afc82bdfd8dd9a2ca45acc83f6c3 @@ -513,7 +513,7 @@ PORT_NUMBER - 5901 + 5432 PRESERVE_RESERVED_WORD_CASE @@ -529,7 +529,7 @@ SUPPORTS_TIMESTAMP_DATA_TYPE - Y + N USE_POOLING @@ -555,12 +555,14 @@ none - erp indoteknik production + erp indoteknik production (localhost) select id, x_name, x_manufacture_level, (select x_name from x_manufactures xm2 where xm2.id = xm.parent_id) as parent, pricing_group, (select name from product_public_category ppc where ppc.id in(select product_public_category_id from product_public_category_x_manufactures_rel where x_manufactures_id = xm.id limit 1)) as category, -override_vendor_id +override_vendor_id, +(select product_public_category_id + from product_public_category_x_manufactures_rel where x_manufactures_id = xm.id limit 1) as category_id from x_manufactures xm where xm.write_date >= (now() - '15 days'::interval) 0 @@ -731,6 +733,29 @@ where xm.write_date >= (now() - '15 days'::interval) Asia/Bangkok N + + Integer + normal + category_id + 9 + 0 + Table input + category_id + ####0;-####0 + . + , + + none + N + Y + 0 + N + N + N + en_ID + Asia/Bangkok + N + @@ -757,7 +782,7 @@ where xm.write_date >= (now() - '15 days'::interval) none - dw bi indoteknik + dw bi indoteknik (localhost) 100 N @@ -804,6 +829,11 @@ where xm.write_date >= (now() - '15 days'::interval) override_vendor_id Y + + category_id + category_id + Y + diff --git a/refresh_materialized_view.ktr b/refresh_materialized_view.ktr index 7e2bb98..5435816 100644 --- a/refresh_materialized_view.ktr +++ b/refresh_materialized_view.ktr @@ -522,6 +522,21 @@ growth salesperson Y + + growth salesperson + invoice customer group by brand and year + Y + + + invoice customer group by brand and year + growth brand per year + Y + + + growth brand per year + growth category brand per year + Y + accurate @@ -713,6 +728,44 @@ Y + + growth salesperson + ExecSQL + + Y + + 1 + + none + + + dw bi indoteknik (localhost) + N + N + N + N + refresh materialized view mv_growth_salesperson + N + + + + + + + + + + + + + + + + 1200 + 304 + Y + + salesperson ExecSQL @@ -790,7 +843,7 @@ - growth salesperson + invoice customer group by brand and year ExecSQL Y @@ -805,7 +858,7 @@ N N N - refresh materialized view mv_growth_salesperson + refresh materialized view mv_invoice_customer_group_brand_year N @@ -822,7 +875,83 @@ - 1200 + 944 + 304 + Y + + + + growth brand per year + ExecSQL + + Y + + 1 + + none + + + dw bi indoteknik (localhost) + N + N + N + N + refresh materialized view mv_brand_per_year + N + + + + + + + + + + + + + + + + 720 + 304 + Y + + + + growth category brand per year + ExecSQL + + Y + + 1 + + none + + + dw bi indoteknik (localhost) + N + N + N + N + refresh materialized view mv_category_brand_per_year + N + + + + + + + + + + + + + + + + 560 304 Y -- cgit v1.2.3