View approach.
Posted in 1992
I am losing an argument with isql 4.10. I hope someone out with more experience with this system will be able to steer me in the right direction. I have a bucketload of time series data (1600+ channels of hourly building energy use data) currently modeled as one table per channel (timestamp,value). There is a natural view on subsets of these channels: whole building. The problem is that I need an outer join on the individual channels. For instance, the chilled water use at a particular time needs to show up in the whole building view even if the electricity use is missing (no matching timestamp in its table). As there is no naturally dominant channel, I created an artificial one : timestamps ranging across several years and used it as the preserved table in the outer join. Now: How do I get rid of those rows that have NO data. i.e. that building returned no points at one of the times in the timestamp table. (That timestamp needs to remain, some other building may have reported at that time). What has failed: 1) Using a (v1 is not null or v2 is not null or v3 is not null ....) in the select statement for the view. Informix applies the where conditions before performing the outer_join action. 2) Making a view that assembles the channels and a view on that view that strips out the undesirable rows. This is confusing me. The outer_joining action appears to be taking place even after the filters in select statements on that view. For instance, select * from wb_100 where wb_elec>1000 does NOT behave as expected. If wb_elec is <=1000 or null, the select returns a row with wb_elec set to null. What am I missing? RjS rjsparks@lstar31.tamu.edu Robert Sparks