Solved

10774: SQL Query Performance Tuning

Posted on 2014-10-08
5
238 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 46

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now