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


Fragmented pages in tables not changing


Fragmented pages in tables not changing

Author
Message
HildaJ
HildaJ
SSC-Addicted
SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)

Group: General Forum Members
Points: 489 Visits: 571
I have several tables in a database that shows a high percentage in fragmentation. I created a maintenance plan and runs succesfully however, the fragmentation is not changing.

For example the table below has a 52% fragmentation and pagecount of 109,208 but the rebuild index task doesn't change it.

objectname objectid indexid partitionnum frag pagecount
pricevalue 832955731 1 1 52.0331600907694 109288


I'm just wondering if there's anything I need to do or that I'm doing wrong.

Thank you.
arnipetursson
arnipetursson
Mr or Mrs. 500
Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)

Group: General Forum Members
Points: 543 Visits: 1019
What are the contents of your maintenance plan?
Does it rebuild indexes base on a fragmentation threshold.

In general I would recommend Ola Hallengren's Index and Statistics maintenance script.
It is widely considered the gold standard.

http://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html
Steve Jones
Steve Jones
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: Administrators
Points: 64587 Visits: 19118
Do you have lots of free space in your databases?

In terms of the object, what's the way that it's structured? Is the row size significant compare to page size? Fill factor? it's possible that you can't do much to change the fragmentation, I'd doubt it, but that could be the case.

Can you give the DDL and commands you are running.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
GilaMonster
GilaMonster
SSC Guru
SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)

Group: General Forum Members
Points: 89471 Visits: 45284
Got a shrink operation running, automatic or manual?

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


HildaJ
HildaJ
SSC-Addicted
SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)

Group: General Forum Members
Points: 489 Visits: 571
---What are the contents of your maintenance plan? Does it rebuild indexes base on a fragmentation threshold.

I'm using the default setting for the rebuild index task which generates the script below:

USE [TestDB]
GO
ALTER INDEX [pk_index] ON [dbo].[tablename] REBUILD PARTITION = ALL WITH ( PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, ONLINE = OFF, SORT_IN_TEMPDB = OFF )


----Do you have lots of free space in your databases? In terms of the object, what's the way that it's structured? Is the row size significant compare to page size? Fill factor? Can you give the DDL and commands you are running.

The database is about 1.9 GB and it has about 25% free space of the mdf file. I think the row count is significatly bigger thatn the page count. The fill factor is the default.

objectname objectid indexid partitionnum frag pagecount RowCount
pricevalue 832955731 1 1 52.0331600907694 109288 3977981



--Got a shrink operation running, automatic or manual?
No I don't have a shrink operation running.

Thank you for all your replies. I'll be reviewing http://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html to hopefully find out more and learn more about rebuilding indexing.
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