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


it's a bug?


it's a bug?

Author
Message
LOVER OF SQL
LOVER OF SQL
SSC-Enthusiastic
SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)

Group: General Forum Members
Points: 106 Visits: 451
Hello guys,

I've this command:

Select db_name(DB_ID()) as DBName,SS.name as SchemaName,SO.name as TableName, SI.name as Indexname,index_type_desc as IndexType ,avg_fragmentation_in_percent as FragmentationPercentage, (case when avg_fragmentation_in_percent between 10 and 30 then 'Defrag'when avg_fragmentation_in_percent > 30 Then 'Reindex'Else 'Can be Ignored Currently'End) as Recomendation from sys.dm_db_index_physical_stats(DB_ID(DB_NAME()), null, null, null, 'DETAILED') IPS , sys.indexes SI ,sys.objects SO , sys.schemas SS where IPS.index_id=SI.index_id and IPS.object_id=SI.object_id andSI.object_id=SO.object_id and SO.schema_id=SS.schema_id andIPS.index_type_desc in ('NONCLUSTERED INDEX', 'CLUSTERED INDEX') Order by Recomendation desc


and show some rows with FragmentationPercentage 11,1111111 and 15,11111 etc.

i wrote

alter index nameindex on object reorganize, BUT

its continue show me FragmentationPercetange 11,1111111 and 15,11111, that is normally?

is not show me FragmentationPercetange 0 ?

thanks all
GilaMonster
GilaMonster
SSC Guru
SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)

Group: General Forum Members
Points: 91905 Visits: 45285
Neither rebuild nor reorganise is expected to reduce fragmentation to 0. If the index is very small it's unlikely to change the fragmentation at all. No, it's not a bug.

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


LOVER OF SQL
LOVER OF SQL
SSC-Enthusiastic
SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)

Group: General Forum Members
Points: 106 Visits: 451
I understood.

So, it's normally i've 11,1111 when i use REORGANIZE so? is not possible my fragmentation is lower?
GilaMonster
GilaMonster
SSC Guru
SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)

Group: General Forum Members
Points: 91905 Visits: 45285
The DMV is correct. If it shows 11.1111%, then that index is 11.1111% fragmented.

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


LOVER OF SQL
LOVER OF SQL
SSC-Enthusiastic
SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)

Group: General Forum Members
Points: 106 Visits: 451
All right, but is possible i have low a fragmentation? ex: 5,55555 or 3,3333 using reorganize or similar?

Microsoft recommends:

If avg_fragmentation_in_percent > 5% and < 30%, then use ALTER INDEX REORGANIZE:

yes, i used, but it's continue 11,11111....

it's my doubt.

thank you very much dude!
GilaMonster
GilaMonster
SSC Guru
SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)

Group: General Forum Members
Points: 91905 Visits: 45285
If the DMV shows that the index has 11.111% fragmentation, then the index has 11.111% fragmentation. Not 5%, not 3%, 11.111%. The DMV is accurate.

If the index is small (which it very likely is) the fragmentation is meaningless and should be ignored.

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


LOVER OF SQL
LOVER OF SQL
SSC-Enthusiastic
SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)

Group: General Forum Members
Points: 106 Visits: 451
hm, all right.

last doubt dude...

i have this index:

id index_type_desc index_id avg_frag
1 CLUSTERED INDEX 0 80

alter index indexname
on table X
rebuild with (online=on)


after that i have avg_frag = 20.

so, i'll consider that 20 is normally because size my index... all right?
GilaMonster
GilaMonster
SSC Guru
SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)SSC Guru (91K reputation)

Group: General Forum Members
Points: 91905 Visits: 45285
No idea. Maybe. Possibly not.

Ignore fragmentation on very small indexes. It's meaningless on very small indexes (which are the ones that usually show this kind of behaviour)

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


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