So for a set of tables I am trying to get personIds for people who are students which is a slow query (~30 seconds) so in an attempt to speed things up I am trying to make a view out of this.
This question is about the view. I have a view with 1 int column and ~1,000,000 rows.
A simple: SELECT [PersonId] FROM [yoda_lat].[dbo].[person_view]
still takes ~ 25 seconds to complete. I am going to suggesting caching the result of this to the people developing for this database but am wondering what else I can do to speed this up.
The query the view is built from shouldn't matter once the view is created yes? I see stuff about adding indexes for more complicated selects, but I am literally trying to grab every value for this single column which is the only column of the view.