I have a table of data that gets update once a week. I then have a query that process this data and essentially returns a list of codes and the amount of hours booked to those codes. This query is reasonably complicated and takes about 5 seconds to run.
This data needs to be used by a lot of other query's in the DB, so I want to put it somewhere that it can be accessed easily by other query's. Doing this in view seemed like a good idea, but that means that every time this view is called it will re-run this query, taking 5 seconds, if there are a lot of calls to this in one go then its going to cause the app to slow down.
So I was thinking, would it be better to create this view as a table when the data is imported on a Monday, as that will be the only time this changes. Is this the best Idea, or am I looking at this the wrong way?