Optimize SQL Server query -
i have created view returns data more 1 table using join. when select view without using order by
clause, time taken execute query 1 second or less. when use order by
select query, takes 27 seconds return top(15)
records view.
here query run data view
select top(15) * v_transaction order time_stamp desc
note : total number of records view has 300000
what can change in view's design better performance?
first thing pops mind creating index on time_stamp
in view. if don't want to/can't create indexed view create index on column in underlying table getting value from. should increase queries performance.
if still having issues post execution plan - should show where/why query experiencing performance problems.
Comments
Post a Comment