goofaholix
MIS
I have reports based on an operational data store / data warehouse type database.
I'm trying to find some solutions to help with our performance issues, many reports are highly parameterised and also need to return detailed data so scheduling, caching, and aggregate tables don't really suit.
95% of the time reports are only looking at the past couple of years data but we need to be able to report 10+ years worth of data at times.
I wondered if it would be possible to set something up where we had two tables for each table, one containing all data the other containing only the past couple of years data. Then based on the start date of the report it would either select from the smaller table or the bigger table if necessary.
I don't want to create this multiple times in each proc or report query as I don't think it's worth the extra hassle.
I thought I could do it as a function so I would use instead of the table name dbo.FunctionName(@StartDate) the trouble is I understand a function like this may not be very efficient, so negating the purpose. Also I think I'll have to do it as a multi value function which means itemising each column name and creating more maintenance each time I add or modify a column in my table(s).
Does anybody have suggestions on how I could achieve this without creating too much extra maintenance/development effort?
Thanks
Bruce
I'm trying to find some solutions to help with our performance issues, many reports are highly parameterised and also need to return detailed data so scheduling, caching, and aggregate tables don't really suit.
95% of the time reports are only looking at the past couple of years data but we need to be able to report 10+ years worth of data at times.
I wondered if it would be possible to set something up where we had two tables for each table, one containing all data the other containing only the past couple of years data. Then based on the start date of the report it would either select from the smaller table or the bigger table if necessary.
I don't want to create this multiple times in each proc or report query as I don't think it's worth the extra hassle.
I thought I could do it as a function so I would use instead of the table name dbo.FunctionName(@StartDate) the trouble is I understand a function like this may not be very efficient, so negating the purpose. Also I think I'll have to do it as a multi value function which means itemising each column name and creating more maintenance each time I add or modify a column in my table(s).
Does anybody have suggestions on how I could achieve this without creating too much extra maintenance/development effort?
Thanks
Bruce