SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Indexes for Booking Search


Indexes for Booking Search

Author
Message
GilaMonster
GilaMonster
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86112 Visits: 45229
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, MVP, M.Sc (Comp Sci)
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


Grant Fritchey
Grant Fritchey
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38999 Visits: 32616
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86112 Visits: 45229
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, MVP, M.Sc (Comp Sci)
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


Grant Fritchey
Grant Fritchey
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38999 Visits: 32616
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
TheSQLGuru
TheSQLGuru
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12218 Visits: 8539
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 on googles mail service
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search