Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

fillfactor Expand / Collapse
Author
Message
Posted Wednesday, July 29, 2009 4:54 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 10:04 AM
Points: 410, Visits: 996
what is fillfactor and what are the advantages and disadvantages?
Post #761380
Posted Wednesday, July 29, 2009 6:34 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, January 26, 2014 11:13 AM
Points: 2,242, Visits: 3,641
charipg (7/29/2009)
what is fillfactor and what are the advantages and disadvantages?


Refer this BOL link to know about fill factor.
http://msdn.microsoft.com/en-us/library/ms177459.aspx

A fill factor of 30 means 30% of space within the data page will be kept vacant, so that when you insert more rows later, they would be accomodated within this free space. This means sql server will not ask for new pages to accomodate your data every time you insert and hence pages will be contiguous, leading to better performance.





Pradeep Singh
Post #761453
Posted Wednesday, July 29, 2009 6:39 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 4:48 AM
Points: 14,802, Visits: 27,278
And fill factor is applicable when creating or rebuilding an index. Once an index is operation or it gets reorganized, fill factor is no longer taken into account.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #761463
Posted Wednesday, July 29, 2009 12:54 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, March 27, 2014 2:29 PM
Points: 990, Visits: 13,439
ps (7/29/2009)
charipg (7/29/2009)
what is fillfactor and what are the advantages and disadvantages?


Refer this BOL link to know about fill factor.
http://msdn.microsoft.com/en-us/library/ms177459.aspx

A fill factor of 30 means 30% of space within the data page will be kept vacant, so that when you insert more rows later, they would be accomodated within this free space. This means sql server will not ask for new pages to accomodate your data every time you insert and hence pages will be contiguous, leading to better performance.


Just to continue on Pradeeps response, the disadvantage of a low fill factor is that the index takes up more disk space. the space is allocated ready for the data to go into the page/extent but if you have say 10% fill factor then only 10% is acually used, which means your index will take up 10 times more space than the same index will a fill factor of 100 (or 0, which is the same as 100)

The dissadvantage (which you can probably also work out from Pradeeps response) is that if you have a high fill factor and you have a lot of inserts you will have a lot of page splits which will cause fragmentation (the reason we rebuild/reindex indexes).
Post #761901
Posted Wednesday, July 29, 2009 1:00 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 11:24 AM
Points: 32,781, Visits: 14,942
This also impacts performance. Lower fillfactor, more reads to get the data.

You have to find a good balance for heavily accessed tables that accounts for reads and writes.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #761909
Posted Wednesday, July 29, 2009 1:16 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 28, 2009 11:23 AM
Points: 184, Visits: 166
hi,

the fillfactor effect specifies the percentage of space filled on index data pages when an index is initially created. The default fillfactor setting of zero, which can be altered at the global server level through a configuration option, will cause an index to be almost filled to capacity, with only a small amount of space being left at the upper level region of the index. A 100% setting completely fills each index page.

One important thing to remember is that this amount is not adhered to after the index is first built. An index can be rebuilt and the original fillfactor setting re-instituted with the variety of DBCC index rebuild or ALTER INDEX (SQL Server 2005) commands.

So, what exactly are the considerations with fillfactor? Higher fillfactor settings should result in less index pages which in turn should result in fewer pages read during scan operations. As been mentioned many times already, less I/O generally equates to better performance.

However, high fillfactor settings can also result in page splits for clustered indexes when SQL Server enforces the sort order of the clustered index during INSERT or UPDATE actions. This happens because SQL Server does not have room on an index page for the requested change, so it has to split the page to perform the modification. This can result in performance degradation and can be confirmed by carefully watching the page splits counter, available from the page_splits query below:

select
cntr_value
from
master.dbo.sysperfinfo
where
counter_name = 'Page Splits/sec' and
object_name like '%Access methods%'

If there are tables present that are primarily read only, a fillfactor setting of 100 should be used to reduce the number of produced index pages.

If, however, there are tables present with high rates of INSERT, UPDATE and DELETE activity, lower fillfactor settings of 50-60% should be used. This will need to be coupled with periodic index rebuilds that will re-establish the fillfactor setting to keep DML running smooth through the indexes.

A mixed environment can work well with fillfactor settings in the neighborhood of 75%. One last piece of advice: for small indexes that have few pages, time should not be wasted worrying about fillfactor as it will not be capable of impacting the database’s performance for the worse.

Post #761921
Posted Wednesday, July 29, 2009 1:38 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Saturday, April 12, 2014 11:40 AM
Points: 2,795, Visits: 8,297
ps (7/29/2009)
charipg (7/29/2009)
what is fillfactor and what are the advantages and disadvantages?


Refer this BOL link to know about fill factor.
http://msdn.microsoft.com/en-us/library/ms177459.aspx

A fill factor of 30 means 30% of space within the data page will be kept vacant, so that when you insert more rows later, they would be accomodated within this free space. This means sql server will not ask for new pages to accomodate your data every time you insert and hence pages will be contiguous, leading to better performance.

I think you meant: A fill factor of 70 means 30% of space within the data page will be kept vacant



Post #761934
Posted Wednesday, July 29, 2009 9:00 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, January 26, 2014 11:13 AM
Points: 2,242, Visits: 3,641
homebrew01 (7/29/2009)

I think you meant: A fill factor of 70 means 30% of space within the data page will be kept vacant


Thanks for the correction





Pradeep Singh
Post #762083
Posted Thursday, July 30, 2009 12:12 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 10:04 AM
Points: 410, Visits: 996
thanks to all........
Post #762170
Posted Wednesday, December 11, 2013 11:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, December 11, 2013 11:54 AM
Points: 2, Visits: 17
Thanks for the information.
It was useful for me, I was looking for an answer so clear as yours.
Greetings from Mexico.
Post #1522010
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse