Unix Technical Forum

dbcc reindex issue - - I don't understand!!

This is a discussion on dbcc reindex issue - - I don't understand!! within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi Folks, SQL Server 2000 SP3 on Windows 2000. I have a database on which I ran the command ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 07:46 PM
Raziq Shekha
 
Posts: n/a
Default dbcc reindex issue - - I don't understand!!

Hi Folks,

SQL Server 2000 SP3 on Windows 2000. I have a database on which I ran
the command :

dbcc dbreindex ('tablename')
go

for all tables in the database. Then I compared the dbcc showcontig
with all_index output from before and after the reindex and on the
largest table in the database I found this. First output is prior to
reindex:


Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
7
TABLE level scan performed.
- Pages Scanned................................: 184867
- Extents Scanned..............................: 23203
- Extent Switches..............................: 23324
- Avg. Pages per Extent........................: 8.0
- Scan Density [Best Count:Actual Count].......: 99.07% [23109:23325]
- Logical Scan Fragmentation ..................: 11.13%
- Extent Scan Fragmentation ...................: 35.46%
- Avg. Bytes Free per Page.....................: 60.0
- Avg. Page Density (full).....................: 99.26%


Second output is from after the reindex:



DBCC SHOWCONTIG scanning 'PlannedTransferArchive' table...
Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
8
TABLE level scan performed.
- Pages Scanned................................: 303177
- Extents Scanned..............................: 37964
- Extent Switches..............................: 42579
- Avg. Pages per Extent........................: 8.0
- Scan Density [Best Count:Actual Count].......: 89.00% [37898:42580]
- Logical Scan Fragmentation ..................: 43.19%
- Extent Scan Fragmentation ...................: 24.78%
- Avg. Bytes Free per Page.....................: 75.1
- Avg. Page Density (full).....................: 99.07%


Following are my concerns:

The following numbers are all higher after reindex than before reindex:

pages scanned, extent switches, logical scan fragmentation, avg bytes
free per page, avg page density.

scan density is lower after reindex than before reindex

Seems to me that the numbers that are higher after reindex should be
lower and numbers that are lower after reindex should be higher? I
didn't specify the fill factor in the dbcc reindex command so it should
have used the default fill factor. The fill factor has never been
changed on this machine.

Am I missing something?

Thanks,
Raziq.


*** Sent via Developersdex http://www.developersdex.com ***
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 07:46 PM
Stu
 
Posts: n/a
Default Re: dbcc reindex issue - - I don't understand!!

Did you not already post this message before, or am i experiencing deja
vu?

Your database id's are different, which means that you ran the
showcontig command on a different database. Did you make a backup and
restore it?

Raziq Shekha wrote:
> Hi Folks,
>
> SQL Server 2000 SP3 on Windows 2000. I have a database on which I ran
> the command :
>
> dbcc dbreindex ('tablename')
> go
>
> for all tables in the database. Then I compared the dbcc showcontig
> with all_index output from before and after the reindex and on the
> largest table in the database I found this. First output is prior to
> reindex:
>
>
> Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
> 7
> TABLE level scan performed.
> - Pages Scanned................................: 184867
> - Extents Scanned..............................: 23203
> - Extent Switches..............................: 23324
> - Avg. Pages per Extent........................: 8.0
> - Scan Density [Best Count:Actual Count].......: 99.07% [23109:23325]
> - Logical Scan Fragmentation ..................: 11.13%
> - Extent Scan Fragmentation ...................: 35.46%
> - Avg. Bytes Free per Page.....................: 60.0
> - Avg. Page Density (full).....................: 99.26%
>
>
> Second output is from after the reindex:
>
>
>
> DBCC SHOWCONTIG scanning 'PlannedTransferArchive' table...
> Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
> 8
> TABLE level scan performed.
> - Pages Scanned................................: 303177
> - Extents Scanned..............................: 37964
> - Extent Switches..............................: 42579
> - Avg. Pages per Extent........................: 8.0
> - Scan Density [Best Count:Actual Count].......: 89.00% [37898:42580]
> - Logical Scan Fragmentation ..................: 43.19%
> - Extent Scan Fragmentation ...................: 24.78%
> - Avg. Bytes Free per Page.....................: 75.1
> - Avg. Page Density (full).....................: 99.07%
>
>
> Following are my concerns:
>
> The following numbers are all higher after reindex than before reindex:
>
> pages scanned, extent switches, logical scan fragmentation, avg bytes
> free per page, avg page density.
>
> scan density is lower after reindex than before reindex
>
> Seems to me that the numbers that are higher after reindex should be
> lower and numbers that are lower after reindex should be higher? I
> didn't specify the fill factor in the dbcc reindex command so it should
> have used the default fill factor. The fill factor has never been
> changed on this machine.
>
> Am I missing something?
>
> Thanks,
> Raziq.
>
>
> *** Sent via Developersdex http://www.developersdex.com ***


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 07:46 PM
Erland Sommarskog
 
Posts: n/a
Default Re: dbcc reindex issue - - I don't understand!!

Raziq Shekha (raziq_shekha@anadarko.com) writes:
> for all tables in the database. Then I compared the dbcc showcontig
> with all_index output from before and after the reindex and on the
> largest table in the database I found this. First output is prior to
> reindex:
>
>
> Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
> 7
> TABLE level scan performed.
> - Pages Scanned................................: 184867
> - Extents Scanned..............................: 23203
> - Extent Switches..............................: 23324
> - Avg. Pages per Extent........................: 8.0
> - Scan Density [Best Count:Actual Count].......: 99.07% [23109:23325]
> - Logical Scan Fragmentation ..................: 11.13%
> - Extent Scan Fragmentation ...................: 35.46%
> - Avg. Bytes Free per Page.....................: 60.0
> - Avg. Page Density (full).....................: 99.26%


With this scan density, defragmentation may be no be very useful.

> DBCC SHOWCONTIG scanning 'PlannedTransferArchive' table...
> Table: 'PlannedTransferArchive' (1975014117); index ID: 1, database ID:
> 8
> TABLE level scan performed.
> - Pages Scanned................................: 303177


I've also seen this that the reserved space for the table increases
and almost double. My speculation have been that space is reserved
for future reindex operations, but I have not dug into it.



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-29-2008, 07:46 PM
Raziq Shekha
 
Posts: n/a
Default Re: dbcc reindex issue - - I don't understand!!

Yes, I did repost this because i did not get any answers the first time.
Yes, I did restore the backup of a database and created a new database.



*** Sent via Developersdex http://www.developersdex.com ***
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:50 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com