Hi,
I'm finding it really frustrating trying to design reports which are capable of responding quickly when base tables are keyed using timestamps.
I have production, delay, runtime etc data which is generally keyed in the original tables using a timestamp. Some data goes back to 2001. Selection of this data for a time period, from the native tables and within DAI, is very fast using 'between' criteria. For example, the following query returns data within about a second from a table of 80 million rows.
select * from log where
machine = 'NM10' and
timestamp >= date('16-Jun-2008') and
timestamp < date('16-Jun-2008') + date('1 day')
However, within DAI use of 'between' criteria is not always appropriate. For example, displaying a runchart of data for a single day should only require the user to pick a single date from a calendar input. I can produce views of the data tables which include separate calculated 'date' and 'time' fields, but using these requires limiting the available date range otherwise processing time is extremely long. That is, I cannot simply allow the entire table contents to be considered. One table, for example, has around 80 million rows back to 2001. While selecting data for any time period using 'between' criteria is almost instantaneous, using a view becomes unusably slow.
So, what I really want to be able to do is to implement a 'between' type select statement whilst only having to input a single date (day/month/year) preferably using the DAI calendar picker.
I've nearly been able to achieve what I want using a dynamic sql view with a date parameter, shown below. The only problem is that I can see no way of forcing the date parameter entry to be done via a date picker, which would be really, really nice! This is not a real show stopper, but easy date picking would be a real feature for a lot of applications I have in mind. I can arrange for a date picker to work OK when using a dynamic sql view ... but the limitation on depth of data availability means this approach won't generally be reliable.
Any other advice on how to work with large data sets having timestamp keys would be appreciated. Does it sound like I'm doing something really wrong?
Regards,
Greg Shearer