how to improve select query performance? if table with millions of record
How to improve select query performance? if table with millions of rec
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
how to improve select query performance? if table with millions of record
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Anant VernekarRank #1,055 · 1.8K reputationPosted Jul 4, 2021, 2:13 AM EDT
1. Use EXISTS instead of IN to check existence of data
2. Avoid * in SELECT statement. Give the name of columns which you require
3.Avoid Having Clause. Having clause is required if you further wish to filter the result of an aggregations.
4.Create Clustered and Non-Clustered Indexes.Keep clustered index small since the fields used in clustered index may also used in non-clustered index.
5.Most selective columns should be placed leftmost in the key of a non-clustered index.Drop unused Indexes.
6.Better to create indexes on columns that have integer values instead of characters. Integer values use less overhead than character values.
7.Use joins instead of sub-queries
8.Avoid Cursors since cursor are very slow in performance
You can refer this article for more elobration...
https://www.c-sharpcorner.com/UploadFile/f0b2ed/tips-to-increase-sql-server-query-performance-part-1/
Nabin Agarwala196 reputationPosted Jul 4, 2021, 4:49 AM EDT