473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Quick SQL Server 7.0 index question

xyz
At the moment I only know enough about SQL Server to create the databases I
need as a backend for the various internal desktop/web applications I write.
I haven't ever had the time to get seriously involved with internal workings
of SQL Server and we are far too small to employ a DBA.

With any new application performance isn't a problem as the number of
records is very low. Over the life of the application the number of records
obviously increases and performance can start to suffer. My normal cure is
to use the Query Analyzer to suggest and implement indexes that normally get
things back up to speed.

I was wondering whether SQL Server automatically keeps the created indexes
up to date or do I need to be doing anything else either manually or as a
scheduled job? The databases all have auto create statistics and auto update
statistics enabled.

Any pointers gratefully received

Thanks

Alan
Jul 23 '05 #1
3 1123
Ensure the indexes are periodically defragged. Either by a maintenance
plan or DBCC DBReindex. See BOL for details.

Jul 23 '05 #2
xyz (so*****@somewhere.com) writes:
I was wondering whether SQL Server automatically keeps the created
indexes up to date or do I need to be doing anything else either
manually or as a scheduled job? The databases all have auto create
statistics and auto update statistics enabled.


What can happen with indexes - as well with the data pages them selves -
is that they can get fragmented. Essentially this means that that the
data is not stored as compactly as it could be. Recall that SQL Server
stores data on pages of 8192 bytes size. And these pages are gathered
eight by eight in extents. One extent is usually only for one table
(but the first page for a table goes into a mixed extent.) If there are
lots of insertions and deletions, you can end up with extents with
only some single rows in them. This leads to that SQL Server will have
to perform more disk reads to get the same amount of data.

The easiest way to approach this is to set up a maintenance job that
performs a DBCC DBREINDEX on all tables. (Although this is not the
most effecient. Tables with little fragmentation are best left alone.)

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3
xyz
"Erland Sommarskog" <es****@sommarskog.se> wrote in message
news:Xn*********************@127.0.0.1...
xyz (so*****@somewhere.com) writes:
I was wondering whether SQL Server automatically keeps the created
indexes up to date or do I need to be doing anything else either
manually or as a scheduled job? The databases all have auto create
statistics and auto update statistics enabled.


What can happen with indexes - as well with the data pages them selves -
is that they can get fragmented. Essentially this means that that the
data is not stored as compactly as it could be. Recall that SQL Server
stores data on pages of 8192 bytes size. And these pages are gathered
eight by eight in extents. One extent is usually only for one table
(but the first page for a table goes into a mixed extent.) If there are
lots of insertions and deletions, you can end up with extents with
only some single rows in them. This leads to that SQL Server will have
to perform more disk reads to get the same amount of data.

The easiest way to approach this is to set up a maintenance job that
performs a DBCC DBREINDEX on all tables. (Although this is not the
most effecient. Tables with little fragmentation are best left alone.)

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp


Thanks to both you and louis for the imformation.
Jul 23 '05 #4

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

Similar topics

0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.