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


Cluster That Index! Part Two


Cluster That Index! Part Two

Author
Message
Chris Hedgate
Chris Hedgate
SSCrazy Eights
SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)

Group: General Forum Members
Points: 9251 Visits: 7
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/chedgate/clusterthatindexparttwo.asp

--
Chris Hedgate http://www.hedgate.net/
Contributor to the Best of SQL Server Central volumes
Articles: http://www.sqlservercentral.com/columnists/chedgate/
Frank Kalis
Frank Kalis
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29665 Visits: 289
Hi Chris,
quote:

Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/chedgate/clusterthatindexparttwo.asp


this is no comment on your article, but on your homepage.

The link to your discussion forum yields a

Fatal error: Call to undefined function: pg_connect() in /var/www-sql.nu/phpBB/db/postgres7.php on line 79

error.

Cheers,
Frank

--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/
kyleburke
kyleburke
SSC Veteran
SSC Veteran (219 reputation)SSC Veteran (219 reputation)SSC Veteran (219 reputation)SSC Veteran (219 reputation)SSC Veteran (219 reputation)SSC Veteran (219 reputation)SSC Veteran (219 reputation)SSC Veteran (219 reputation)

Group: General Forum Members
Points: 219 Visits: 40
Great Article. One addition comment about page splitting from your example. If your are worried about page slitting because of heavy inserts to a table put the clustered index on the identity column. Since the clustered index will be order by the data, if you put a clustered index on an identity column then the new row will be added to the end of the data pages and page splits won't occur.



Chris Hedgate
Chris Hedgate
SSCrazy Eights
SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)

Group: General Forum Members
Points: 9251 Visits: 7
quote:

this is no comment on your article, but on your homepage.

The link to your discussion forum yields a

Fatal error: Call to undefined function: pg_connect() in /var/www-sql.nu/phpBB/db/postgres7.php on line 79

error.



Ah, you mean at sql.nu. Yes, a while back we had a major crash and haven't brought our database online again (since the forums wheren't really used). We're a bit ashamed, but since we're soon moving to an entirely different server and environment we don't want to spend time fixing it now. Thnaks for the heads up though.

--
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
http://www.sql.nu

--
Chris Hedgate http://www.hedgate.net/
Contributor to the Best of SQL Server Central volumes
Articles: http://www.sqlservercentral.com/columnists/chedgate/
Chris Hedgate
Chris Hedgate
SSCrazy Eights
SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)SSCrazy Eights (9.3K reputation)

Group: General Forum Members
Points: 9251 Visits: 7
quote:

Great Article. One addition comment about page splitting from your example. If your are worried about page slitting because of heavy inserts to a table put the clustered index on the identity column. Since the clustered index will be order by the data, if you put a clustered index on an identity column then the new row will be added to the end of the data pages and page splits won't occur.



Thanks Kyle, great comment. That should have been in the article as well, but I guess there'll be a part 3 some time.

--
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
http://www.sql.nu

--
Chris Hedgate http://www.hedgate.net/
Contributor to the Best of SQL Server Central volumes
Articles: http://www.sqlservercentral.com/columnists/chedgate/
chrismj
chrismj
Old Hand
Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)Old Hand (378 reputation)

Group: General Forum Members
Points: 378 Visits: 245

True, but that kind of defeats the purpose of the clustered index, as you are not likely to do searches on the ID, specially not range searches. You should cluster on other incrementing values that are carrying information, like creation date.





Vic Kirkpatrick
Vic Kirkpatrick
Say Hey Kid
Say Hey Kid (686 reputation)Say Hey Kid (686 reputation)Say Hey Kid (686 reputation)Say Hey Kid (686 reputation)Say Hey Kid (686 reputation)Say Hey Kid (686 reputation)Say Hey Kid (686 reputation)Say Hey Kid (686 reputation)

Group: General Forum Members
Points: 686 Visits: 1
Depending (of course) on the business need. Here, we have plenty of tables in which we only query them via the identity column (PK). There are no columns that require searching through ranges of data on these tables, so in these cases Kyle's comment holds water.
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