Solved

10774: SQL Query Performance Tuning

Posted on 2014-10-08
5
246 Views
Last Modified: 2014-10-08
Hello experts:

Based on your experience, I can recommend very good articles on this topic: SQL Query Performance Tuning
0
Comment
Question by:enrique_aeo
  • 3
5 Comments
 
LVL 49

Expert Comment

by:Vitor Montalvão
ID: 40368658
What's the question?
0
 
LVL 22

Accepted Solution

by:
plusone3055 earned 500 total points
ID: 40368665
0
 

Author Comment

by:enrique_aeo
ID: 40368668
What are the problems with table indexes database.
0
 

Author Comment

by:enrique_aeo
ID: 40368698
I prefer URL with T-SQL
0
 

Author Comment

by:enrique_aeo
ID: 40368762
Please experts

code T-SQL for to close the question

"1. Don't use UPDATE instead of CASE
This issue is very common, and though it's not hard to spot, many developers often overlook it because using UPDATE has a natural flow that seems logical.

Take this scenario, for instance: You're inserting data into a temp table and need it to display a certain value if another value exists. Maybe you're pulling from the Customer table and you want anyone with more than $100,000 in orders to be labeled as "Preferred." Thus, you insert the data into the table and run an UPDATE statement to set the CustomerRank column to "Preferred" for anyone who has more than $100,000 in orders. The problem is that the UPDATE statement is logged, which means it has to write twice for every single write to the table. The way around this, of course, is to use an inline CASE statement in the SQL query itself. This tests every row for the order amount condition and sets the "Preferred" label before it's written to the table. The performance increase can be staggering."
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Many to one in one row 2 41
Split string into 3 separate fields 5 22
How to trim a value in SQL 2 29
Need to find substring in SQL 3 15
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to shrink a transaction log file down to a reasonable size.

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question