[Swift-commit] r5499 - provenancedb

lgadelha at ci.uchicago.edu lgadelha at ci.uchicago.edu
Tue Jan 17 10:53:00 CST 2012


Author: lgadelha
Date: 2012-01-17 10:53:00 -0600 (Tue, 17 Jan 2012)
New Revision: 5499

Modified:
   provenancedb/prov-init.sql
Log:
New views for schema summarization


Modified: provenancedb/prov-init.sql
===================================================================
--- provenancedb/prov-init.sql	2012-01-10 20:21:45 UTC (rev 5498)
+++ provenancedb/prov-init.sql	2012-01-17 16:53:00 UTC (rev 5499)
@@ -195,15 +195,7 @@
      q        varchar(2048)
    );
 
-create view function as select * from proc natural join app_inv;
 
-create view dataset as 
-    select file.id, 'mapped' as type, file.name as filename, null as value
-    from file
-  union 
-    select in_mem.id, 'primitive' as type, null as filename, in_mem.value
-    from in_mem;
-
 drop view pgraph_edge;
 create view pgraph_edge as 
        select proc_id as parent,ds_id as child from ds_out
@@ -214,28 +206,81 @@
 
 -- continue renaming from here
 
-CREATE VIEW run_date AS
-  SELECT id, log_filename, swift_version, cog_version, final_state, 
-         to_timestamp(start_time) as start_time, duration
-  FROM   run;
 
 CREATE VIEW a_t AS
     SELECT *
     FROM a_run_t 
-  UNION
+  UNION ALL
     SELECT * 
     FROM a_ds_t 
-  UNION 
+  UNION ALL 
     SELECT * 
     FROM a_proc_t;
 
 CREATE VIEW a_n AS
     SELECT *
     FROM a_run_n 
-  UNION
+  UNION ALL
     SELECT * 
     FROM a_ds_n 
-  UNION 
+  UNION ALL 
     SELECT * 
     FROM a_proc_n;
 
+-- views used for queries based on the schema summary
+
+drop view function_call;
+
+create view function_call as 
+    select proc.id, proc.type, proc.name, proc.run_id, app_inv.proc_name, to_timestamp(app_inv.start_time), app_inv.duration, app_inv.final_state, app_inv.scratch from proc natural join app_inv;
+
+drop view variable;
+
+create view variable as 
+    select file.id, 'mapped' as type, file.name as filename, null as value
+    from file
+  union all 
+    select in_mem.id, 'primitive' as type, null as filename, in_mem.value
+    from in_mem
+  union all
+    select ds_cont.out_id as id, 'composite' as type, null as filename, null as value from ds_cont;
+
+drop view annotation;
+
+create view annotation as 
+    select a_t.run_id as id, a_t.name as key, a_t.value as string_value, null as numeric_value
+    from a_t
+  union all
+    select a_n.run_id as id, a_n.name as key, null as string_value, a_n.value as numeric_value
+    from a_n;
+   
+drop view script_run;
+
+create view script_run as
+  select id, log_filename, swift_version, cog_version, final_state, 
+         to_timestamp(start_time) as start_time, duration
+  from   run;
+
+
+drop view application_execution;
+
+create view application_execution as
+  select id, app_inv_id as function_call_id, to_timestamp(start_time) as start_time, duration, final_state, site
+  from   app_exec;
+
+
+drop view runtime_info;
+
+create view runtime_info as
+  select app_exec_id as application_execution_id, tstamp as timestamp, cpu_usage, max_phys_mem, max_virt_mem, io_read, io_write
+  from rt_info;
+
+drop view produces;
+
+create view produces as
+  select proc_id as function_call_id, ds_id as variable_id, param as parameter from ds_out;
+
+drop view consumes;
+
+create view consumes as
+  select proc_id as function_call_id, ds_id as variable_id, param as parameter from ds_in;




More information about the Swift-commit mailing list