5 Tips Speed up SQL Queries

  By Rizwan Saqib   Posted on March-27-2018   612

MS Sql Server

Indexes :

If you want your sql queries work and Execute fast we have tips for your  First our Topic is Index There is Three Types of Index

1.Clustered Index

2.Non Clustered Index

3.Unique Index

When we create a table in SQL Clustered index auto apply on Primary key ID  but we create only one Clustered index in One table

we Create Non clustered index on Required fields in this way non clustered stored all table Fields data in seprate when we search data from table it give us result more than fast because all data manage in seprate 

 

For Example 

We have a Employee Table  With Below Fields

1,EmployeeName,

2 Age,

3Salary,

4 Department

1.Non Clustered Index

  Create NonClustered index EmployeeIndex
  On Employee  (EmployeeName,Age,Department)

2.Unique Non Clustered Index

 Create Unique NonClustered index EmployeeIndex
  On Employee  (EmployeeName,Age,Department)

--------------------------------------------------------------------

2.Only Select Fields You Need

Second Tip for speed up sql Query to selcet  only those field you

need in table Because when we Execute the Queries it spend extra

time to execute on Extra fields

--------------------------------------------------------------------

3.Remove Unnecessary Tables

Third Tip is To Remove Unnecessary tables of Quries for Example

if you have a many table in database who can not use in Queries so

if you delete the extra table its affect on Sql Queries Speed

-----------------------------------------------------------------

4.Remove Unnecessary Joins

When we Create Store Procedures and we joins the table to others table if we use Unnecessary joins in Procedure its affect on the speed of Execution but when we use limited joins then speed of queries is up 

-----------------------------------------------------------------

5.Remove Calculated Fields in JOIN and WHERE Clauses

Fifth tip for Speed up Queries Remove Calculated fields in joins and where clauses Because its affect on Queries speed If we use a limited calculated fields  speed of our queries is up 

Indexes :

If you want your sql queries work and Execute fast we have tips for your  First our Topic is Index There is Three Types of Index

1.Clustered Index

2.Non Clustered Index

3.Unique Index

When we create a table in SQL Clustered index auto apply on Primary key ID  but we create only one Clustered index in One table

we Create Non clustered index on Required fields in this way non clustered stored all table Fields data in seprate when we search data from table it give us result more than fast because all data manage in seprate 

 

For Example 

We have a Employee Table  With Below Fields

1,EmployeeName,

2 Age,

3Salary,

4 Department

1.Non Clustered Index

  Create NonClustered index EmployeeIndex
  On Employee  (EmployeeName,Age,Department)

2.Unique Non Clustered Index

 Create Unique NonClustered index EmployeeIndex
  On Employee  (EmployeeName,Age,Department)

--------------------------------------------------------------------

2.Only Select Fields You Need

Second Tip for speed up sql Query to selcet  only those field you

need in table Because when we Execute the Queries it spend extra

time to execute on Extra fields

--------------------------------------------------------------------

3.Remove Unnecessary Tables

Third Tip is To Remove Unnecessary tables of Quries for Example

if you have a many table in database who can not use in Queries so

if you delete the extra table its affect on Sql Queries Speed

-----------------------------------------------------------------

4.Remove Unnecessary Joins

When we Create Store Procedures and we joins the table to others table if we use Unnecessary joins in Procedure its affect on the speed of Execution but when we use limited joins then speed of queries is up 

-----------------------------------------------------------------

5.Remove Calculated Fields in JOIN and WHERE Clauses

Fifth tip for Speed up Queries Remove Calculated fields in joins and where clauses Because its affect on Queries speed If we use a limited calculated fields  speed of our queries is up 

By  Rizwansaqib966    27-Mar-2018 Views  612



You may also read following recent Post