Let\'s say you have a view:
CREATE VIEW dbo.v_SomeJoinedTables AS
SELECT
a.date,
a.Col1,
b.Col2,
DENSE_RANK()
OVER(PARTITION BY a.date, a.
Technically, you're not comparing between the same SQL statements. Your view indicates that it returns a.date, a.Col1, b.Col2,
plus your DENSE_RANK() function. In your query without the view, you return all columns.
At first, you may think that returning all the columns would be worse. But it's difficult to determine which would be better without knowing what the table structure, including indexes, looks like.
Have you compared the query plans for each statement?