Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Index creation help Expand / Collapse
Author
Message
Posted Friday, November 8, 2013 2:48 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, February 24, 2014 10:57 AM
Points: 59, Visits: 1,076
I was analysing an execution plan before and after creation of an index. Disk IO decreased considerably after creation of index but overall operation cost increased(because of lookups)...How do we generally determine if a index was helpful??

Post #1512822
Posted Monday, November 11, 2013 1:16 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
sandyinfowave (11/8/2013)
but overall operation cost increased(because of lookups)...
try to implement covering index on non clustered indexes to remove lookups.

sandyinfowave (11/8/2013)
How do we generally determine if a index was helpful??

When time, cpu, io, memory cost get reduced.


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1513017
Posted Monday, November 11, 2013 4:25 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 5:41 PM
Points: 23,397, Visits: 32,240
First, be careful with making a covering index. Depending on how many columns of data and their sizes may make a covering index quite large. If this is also an active OLTP system maintaining the index may be more expensive than the bookmark lookups.

One thing to look at is the elapsed time of the procedure before and after creating the index.

The cost values you see in the execution plan are basically arbitrary values. You really can't use those by themselves to determine how efficient or inefficient a plan may be.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1513067
Posted Monday, November 11, 2013 4:30 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
Lynn Pettis (11/11/2013)
The cost values you see in the execution plan are basically arbitrary values.
Does this the same case with profiler trace stats too?


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1513068
Posted Monday, November 11, 2013 4:37 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 12:15 PM
Points: 43,017, Visits: 36,179
Bhuvnesh (11/11/2013)
Lynn Pettis (11/11/2013)
The cost values you see in the execution plan are basically arbitrary values.
Does this the same case with profiler trace stats too?


Profiler trace doesn't show optimiser costs anywhere.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1513071
Posted Monday, November 11, 2013 4:40 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
GilaMonster (11/11/2013)
Bhuvnesh (11/11/2013)
Lynn Pettis (11/11/2013)
The cost values you see in the execution plan are basically arbitrary values.
Does this the same case with profiler trace stats too?


Profiler trace doesn't show optimiser costs anywhere.
ohh.. i thought (What lynn mentioned) here cost values are basically values of cpu, io, time etc ?


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1513073
Posted Monday, November 11, 2013 5:03 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 12:15 PM
Points: 43,017, Visits: 36,179
No, those are CPU times, number of IOs and execution times. Costs are what the optimiser calculates, what you see in query plans.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1513080
Posted Friday, November 15, 2013 5:40 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, February 24, 2014 10:57 AM
Points: 59, Visits: 1,076
Thanks for your valuable suggestions...I didn't create a covered index as the number of columns in include statement are more( & table has around 40 million records), didn't want to spend too much time/resources in maintaining index's. I forced the query to use an already existing index(using with index statement) which prevents table scans. Is it advisable to force the query to use an index. I guess sql server should already choose best execution plan based on available indexes right??

I also see Hash Match's in my execution plan..What are these??

So analysing the elapsed time is the only option to decide whether an index is helpful??? (not sure how accurate it is as the SP can be cached)


P.S: elapsed time decreased considerably(almost decreased to 1/4th) after making these changes, but higher than what it used to be in the past(3-4 months ago when the query was running faster)...Not sure what changes happened but it forced me to analyse execution plan

These queries are used for our reporting purposes(to insert data into Reporting tables)


Post #1514879
Posted Monday, November 18, 2013 11:05 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, February 24, 2014 10:57 AM
Points: 59, Visits: 1,076
Any suggestions please??

Post #1515314
Posted Monday, November 18, 2013 10:35 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 5:41 PM
Points: 23,397, Visits: 32,240
Not much more we can do with as little information as you have provided. Please read the second article I reference below in my signature block. It will walk you through what you need to post and how to do it.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1515424
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse