Share via

Select Query Performace Issue

San 161 Reputation points
2022-02-21T10:06:48.287+00:00

Dear Experts,

I have a table which is very slow . How can I improve the performance of the query.

Select * from Fact.Mgn_History (Total # of records in the table 2254281). It take around 15 mins when I just run a Select Statement without giving any condition.

There are few indexed in the table

1) IX_MGN - Clustered Index
2) Act_date - Non Clustered Index
3) ID - Non Clustered Index
4)Mgn_sk - Non Clustered Index

It will really help if something share tips to improve performance.

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL

A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.

SQL Server | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,616 Reputation points
    2022-02-21T10:09:47.867+00:00

    when I just run a Select Statement without giving any condition.

    Then SQL Server always perform a full table scan and depending on data size it takes some time. Not to forget the network workload and client takes time to represent the amount of data. So which improvement do you expect here?

    1 person found this answer helpful.

  2. Erland Sommarskog 133.5K Reputation points MVP Volunteer Moderator
    2022-02-21T23:07:23.053+00:00

    How are you receiving the result?

    What constrains the execution time in this case is not really SQL Server, but rather the client that receives the result.

    And why are you bothering that about this? That is, what is your actual business need? Why do you want get all rows in the table?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.