Re: finding continuous range

From: admin <admin_at_nehalem.net>
Date: Mon, 14 May 2001 22:26:39 -0700
Message-ID: <tg1fggosnmi8e2_at_news.supernews.com>


"Jan Hidders" <hidders_at_REMOVE.THIS.win.tue.nl> wrote in message news:9dpaso$kb2$1_at_news.tue.nl...
>
> Amazing, isn't it. :-) Extending this so it works for several
> generators is left to the reader as an exercize.
>

Many thanks Jan for your excellent help. The code won't be an exercise but an actual production system. The real system actually has data at the date, hour, and minute level with many more columns and attributive relationships. Your wizard insight that produces the dates view set me on the right track.

I got the best performance from my particular system by instantating the view as a temp table and only including those dates which are also for the rows which have the max(megawatts) for that particular start or end point in time. By then joining back to the original schedules to get the max(megawatts) between the new start and end datetimes I get the correct continuous overlaps AND the correct megawatts of "uncovered " schedules for which I had not inserted the begin and end datetimes since they were not the max(megawatts) for their start and end times AND I produce no schedules for times between which there are no underlying schedules. All done with just two passes of the data (three if you count the union).

Thaks again. Received on Tue May 15 2001 - 07:26:39 CEST

Original text of this message