February 4th, 2012, 01:28 PM
Creating a table based on query, and having it auto refresh
I have a query that takes forever to load, and I'm looking for away to speed it up.
Is it possible to create a local "table" using the query and having it auto update on daily or hourly basis so that all I need to do is select* from the local table?
I would appreciate any help...
February 4th, 2012, 03:25 PM
the answer is no
what you were thinking of with the idea of "select star" is a view
however, a view is only as efficient as its underlying query
you need to address your query's inefficiency
there is no way to "automatically" save the results of a query -- you would ahve to do that explicitly with an SQL statement that you execute
February 4th, 2012, 04:29 PM
I was thinking when people speak of stored procedure, this is exactly what it does.
Originally Posted by r937
The query has so many joined table that it takes >20 minutes to run, would be much easire to store the result to a table and having it refresh on daily basis.
I'm just surprised that there is no such feature built into sql