473,725 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Clustered Indexes, what actually happens when you rebuild one, does the optimiser love them?

"Erland Sommarskog" <es****@sommars kog.sewrote in message
news:Xn******** **************@ 127.0.0.1...
>
Overall, I recommend that you always slap a clustered index on your
tables,
unless you have full understanding of the ramifications.
Erland,

I'm sure you mean that to be with love and care, rather than just "slap on"
any clustered index for the sake of it. :) A poorly chosen clustered index
could be worse than none at all.

--
David Portas

Nov 18 '08 #1
1 1543
David Portas (RE************ *************** *@acm.org) writes:
"Erland Sommarskog" <es****@sommars kog.sewrote in message
news:Xn******** **************@ 127.0.0.1...
>>
Overall, I recommend that you always slap a clustered index on your
tables,
unless you have full understanding of the ramifications.

I'm sure you mean that to be with love and care, rather than just "slap
on" any clustered index for the sake of it. :) A poorly chosen clustered
index could be worse than none at all.
Dunno. A simple-minded maintenance plan is going to clean up the mess of
a poorly selected clustered index, whereas there is not much to save a heap.

But, yes, it's certainly a good idea to select your clustered index with
some care, and not just cluster on the primary key without thinking.
Particularly not if the PK is a GUID. Then again, clustering on a GUID
does not have to be bad, as long as you specify a low fill factor, and
reindex with the same low fill factor often enough.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Nov 18 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2036
by: hrishy | last post by:
Hi All I was just wundering what happens if we dont gather stats on indexes will it effect the optimiser plans ? regards Hrishy
2
5137
by: Ryan | last post by:
In oracle you rarely need to rebuild indexes no matter whether you do massive inserts or deletes. Does the same hold true in sql server?
1
2263
by: Steve_CA | last post by:
Hi, The more I read, the more confused I'm getting ! (no wonder they say ignorance is bliss) I just got back from the bookstore and was flipping through some SQL Server Administration books. One says, that to get the best query performance, youi do two things:
4
3846
by: Tryfon Gavriel | last post by:
Hi all I recently noticed when trying to optimise a major query of a chess website I am the webmaster of, that adding an order by for "gamenumber" which is a clustered index field as in for example "order by timeleft desc, gamenumber desc" actually speeded up the queries and reduced sql server 2000 timeouts. I have an ASP error log and I am fairly sure that a dramatic reduction in sql server timeouts is simply attributed to adding an...
5
6067
by: jim_geissman | last post by:
One table I manage has a clustered index, and it includes some varchar columns. When it is initially created, all the columns in the clustered index are populated, and then some of the longer varchars are populated through update queries. If the varchar columns are stored outside the clustered structure, then it would make sense to create the clustered index before populating the varchar columns. Otherwise it would make sense to wait,...
1
1540
by: Unregistered | last post by:
I have following situation: one "message" table and 3 other "message_{1,2,3}" tables which inheri from "message". Every day +-50 000 "messages" are being inserted. I needed something extra to speed up the queries instead of only usin indexes, so I thought of doing something like you can do in Oracle table partitioning. In postgresql you can simulate this using the partial indexes.
2
4348
by: Lyle Fairfield | last post by:
'Property Clustered As Boolean 'Member of DAO.Index Private Sub IsThereaClusteredIndex() Dim tdf As DAO.TableDef Dim idx As DAO.Index For Each tdf In DBEngine(0)(0).TableDefs For Each idx In tdf.Indexes Debug.Print tdf.Name, idx.Name, idx.Primary, idx.Clustered Next idx
5
9720
by: pb648174 | last post by:
I've been doing a bit of reading and have read in quite a few places that an identity column is a good clustered index and that all or at least most tables should have a clustered index. The tool I used to generate tables made them all with non clustered indexes so I would like to drop all of them and generate clustered indexes. So my questions is a) good idea? and b) how? There are foreign key references to most of them so those would...
1
1853
by: Curt | last post by:
What is the difference please?
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.