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

Indexes for Booking Search Expand / Collapse
Author
Message
Posted Tuesday, January 4, 2011 4:15 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: Yesterday @ 8:36 AM
Points: 40,615, Visits: 37,080
Grant Fritchey (1/4/2011)
the PK is not being used to determine access to the table. That at least suggests you should be looking elsewhere for the PK.


Not the PK, the clustered index. Though, from the example of what's in the Kind column, it's a very, very, very bad choice for a cluster.

Could be that some of the nonclustered indexes could benefit from reordering columns. Very hard to tell without doing a complete index analysis (which easily takes a month on a large DB)



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 #1042284
Posted Tuesday, January 4, 2011 4:19 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 8:22 AM
Points: 14,205, Visits: 28,534
GilaMonster (1/4/2011)
Grant Fritchey (1/4/2011)
the PK is not being used to determine access to the table. That at least suggests you should be looking elsewhere for the PK.


Not the PK, the clustered index. Though, from the example of what's in the Kind column, it's a very, very, very bad choice for a cluster.

Could be that some of the nonclustered indexes could benefit from reordering columns. Very hard to tell without doing a complete index analysis (which easily takes a month on a large DB)


Oh crud, did I type 'PK'. Yes, of course I meant cluster. Thanks for correcting me on that. Yes, you're right [Kind] is a terrible choice, but based on all the info we have currently, it's possibly a better choice than the PK. Not saying it's at all a good choice, just a less bad choice.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1042287
Posted Tuesday, January 4, 2011 4:32 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: Yesterday @ 8:36 AM
Points: 40,615, Visits: 37,080
My concern is the comment that was next to the definition of kind:
/* Kinds: Sale / Purchase */

If it's 2 values (and nvarchar255 to boot), it's going to be near-useless as a clustered index. I agree the cluster may well need to move, just don't know to where...



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 #1042293
Posted Tuesday, January 4, 2011 4:53 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 8:22 AM
Points: 14,205, Visits: 28,534
GilaMonster (1/4/2011)
My concern is the comment that was next to the definition of kind:
/* Kinds: Sale / Purchase */

If it's 2 values (and nvarchar255 to boot), it's going to be near-useless as a clustered index. I agree the cluster may well need to move, just don't know to where...


Oh wow! I hadn't noticed that. Again, you're right. This is a poor choice for the cluster... and a poor choice for the leading edge of any of the indexes if that's really the data contained in it.

I'd suggest it also begs the question of where the data type came from, but I already know. That's an artifact of nHibernate. Wonderful piece of software.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1042299
Posted Tuesday, January 4, 2011 8:33 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 7:31 AM
Points: 4,472, Visits: 6,402
1) GUIDs are a terrible design choice - fat and fragmenty (coined a new term there)!

2) no wonder your updates are getting slow - look at how many include columns you have in those indexes! You cannot have you cake and eat it too - either you accept lookups and stop including so many columns just to get a covered index or you suck up the blocking/locking/performance hit of maintaining so many fat indexes.

3) BTW, did you perchance use Database Tuning Advisor to derive those indexes??


Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Post #1042468
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse