How to improve query performance in SQL?
Utilisateur anonyme
There are multiple ways to improve query performance . 1. Owner/Schema Name : Always prefix object names (i.e. table name, stored procedure name, etc.) with its owner/schema name. 2. The * Operator : Do not use the * operator in your SELECT statements. Instead, use column names. 3. Nullable Columns : Do not use NOT IN when comparing with nullable columns. Use NOT EXISTS instead. 4. Table Variables and Joins : Do not use table variables in joins. Use temporary tables, CTEs (Common Table Expressions), or derived tables in joins instead. 5. Stored Procedure Names : Do not begin your stored procedure’s name with sp_. 6. Use SET NOCOUNT ON: Use SET NOCOUNT ON with DML operations. 7. Avoid Using GROUP BY, ORDER BY, and DISTINCT : Avoid using GROUP BY, ORDER BY, and DISTINCT as much as possible