I got a weird situation where each time I want to see the contents of a generated table view it starts loading the data instead of immediately showing the data.
When I use this query the data will be showed immediately:
CREATE VIEW train_set
AS SELECT *
FROM logs where ((logs.timestamp >= '2014-03-01 00:00:00') and (logs.timestamp < '2014-03-16 00:00:00'));
But when I use this query:
CREATE VIEW train_set
AS SELECT *
FROM logs where ((logs.timestamp >= '2014-03-01 00:00:00') and (logs.timestamp < '2014-03-16 00:00:00') and logs.user_id = '10');
for each time I want to see the contents of the Table View: train_set it starts loading like it's actually executing the query again.
Does anyone now why this is? I am using Sequel Pro on my Macbook
It IS executing your query every time you open the view. Thats the point of the view. To get a middle-step in between of your table and the results you want to grab. Or to get a fast view into the database for relevant data (like daily entries).
The only explanation for me is that your first query is just faster so you can't see it loading. But in fact, both are getting executed on every show-up.
I cant imagine why someone would want to create a view which is executed only one time (at creation). Alternativly for this you could just export your stuff to an excel file. Wouldnt that be the same?