You are here:   Home
Register   |  Login
Bookbaby.com - Save 20% on basic eBook cover design with any eBook submission. Coupon Code: COVER20

Captured Technology - Blog

Minimize

Adding Indexes to SQL Server 2005 Tables

Sep 24

Written by:
9/24/2009 4:23 PM  RssIcon

Adding Indexes to SQL Server 2005 Tables

I had the opportunity this week to tune a SQL Server 2005 database to improve the performance of a web application. I first created indexes on the temporary tables within a stored procedure that was causing much of the delay and later discovered through the execution plan, there was specific bottle-neck that could be cleared. Here is an illustration of the temp table indexing:

IF OBJECT_ID('#TempTable') IS NOT NULL
CREATE NONCLUSTERED INDEX [#idxTemp_TempTable_Field1_Field2] ON #TempTable
(
[Field1] ASC,
[Field2] ASC,
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = ON, 
IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = OFF, 
ALLOW_PAGE_LOCKS  = OFF) ON [PRIMARY]

But by executing the same stored procedure in a query window and selecting ‘Include Actual Execution Plan’ from the toolbar, I was able to see it individual query’s cost within the stored procedure. Then it is possible to look at the most expense queries, their most expensive operations, and add indexes to the permanent tables that reduce execution time.

3 comment(s) so far...


Gravatar

Dental Nursing in UK

Good information am going to share with my colleagues about the site.Thx

By Dental Nursing in UK on   11/26/2009 6:59 AM
Gravatar

Re: Adding Indexes to SQL Server 2005 Tables

While adding indexes can improve performance on SELECT queries,A very good Summarised article on INDEXing .. Very helpful for Novices and for experts too to get the gimpse of the ways to add or delete different Indexes on a Database Table.

By Venice Hotels on   8/26/2010 2:35 AM
Gravatar

Re: Adding Indexes to SQL Server 2005 Tables

Hey thanx for the post. Indexing has always been a concern when working with databases. Indexing in temporary tables helps in implementing desired index order to the database. This is an alternate solution for simple indexing. Thanx for sharing.

By Conservatories on   6/3/2011 9:34 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 

FaceBook

Minimize

Mobile Version

Minimize
Add CapturedTech - Technology Mippin widget

Translate

Minimize

Sponsors

Minimize
The best conversion tool

Recent Comments

Minimize
Re: Three Benefits to Using a Royalty-Free Image on Your Website or Blog
Don't pay for royalty free images. They are free after all! I offer links to 96 websites that have tens of thousands (maybe even hundreds of thousands) of absolutely free images, including ones for commercial use! All you need to do is subscribe to my blog at www.davesinternetmarketing.info/royalty-free-images-free-for-commercial-use/
Re: Buzzom Offers Featured User Options
This is when discovered this great new way to grow your follow list. You can pay between $10 and $100 for the number of times you want to app ar at the top of the list.
Re: Microsoft Test Bounties
I had spent a good deal of my time looking for someone to explain this subject clearly and I have really enjoyed reading your blog posts and I collected a lot of interesting things as well as I done a research on the subject and learn most peoples will agree with your blog.
Re: 10 Ways to Source Great Sales Leads
Hoovers.com, that have contact information for tens of millions of businesses. If necessary, you can work with these companies' research teams to order lists specifically tailored to your organization's sales needs.
Re: Microsoft Test Bounties
To find bugs and showing it to microsoft is quite admirable. Keep blogging more i will appreciate.

u comment, i follow