Permalink
Browse files

table -> materialized view. ref #254

  • Loading branch information...
1 parent 8961619 commit 50cc75af2e936eacc848e7085d9c2cac4d3a1a8b @tompollard tompollard committed on GitHub Jul 11, 2017
Showing with 5 additions and 5 deletions.
  1. +5 −5 concepts/durations/ventilation-durations.sql
@@ -14,8 +14,8 @@
-- First, create a temporary table to store relevant data from CHARTEVENTS.
-DROP TABLE IF EXISTS ventsettings CASCADE;
-CREATE TABLE ventsettings AS
+DROP MATERIALIZED VIEW IF EXISTS ventsettings CASCADE;
+CREATE MATERIALIZED VIEW ventsettings AS
select
icustay_id, charttime
-- case statement determining whether it is an instance of mech vent
@@ -158,8 +158,8 @@ where itemid in
--DROP MATERIALIZED VIEW IF EXISTS VENTDURATIONS CASCADE;
-DROP TABLE IF EXISTS VENTDURATIONS CASCADE;
-create table ventdurations as
+DROP MATERIALIZED VIEW IF EXISTS VENTDURATIONS CASCADE;
+create MATERIALIZED VIEW ventdurations as
with vd0 as
(
select
@@ -256,4 +256,4 @@ having min(charttime) != max(charttime)
and max(mechvent) = 1
order by icustay_id, ventnum;
-DROP TABLE ventsettings;
+DROP MATERIALIZED VIEW ventsettings;

0 comments on commit 50cc75a

Please sign in to comment.