
Signature
Andrew J. Kelly SQL MVP
Solid Quality Mentors
Andrew,
Thanks for the information. In looking at the still fragemented indexes
most are non-clustered indexes. There were a few clustered indexes still
showing as needing reorganizing/rebuilding, but as you pointed out, they had
few pages. The largest one I saw had 30 pages and was still showing as
needing reorganizing. ?Would you define a few pages as less than 50? Is
that a good estimate? One other question: Is there a way to tell if a table
uses mixed extents? This would enable you to identify those tables where
fragmentation would always exist to some degree.
Thanks,

Signature
Michael Strozzo
SQL DBA
> If the tables are Heaps you can reindex all day long and it wont change a
> thing. You need a clustered index on the table in order to be able to remove
[quoted text clipped - 19 lines]
> >
> > Thanks!
Tibor Karaszi - 11 Jul 2008 18:47 GMT
Few pages = less than 1000. The report should account for that, but apparently it doesn't.

Signature
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
> Andrew,
>
[quoted text clipped - 32 lines]
>> >
>> > Thanks!
Andrew J. Kelly - 11 Jul 2008 19:59 GMT
Anything less than 8 pages will always use mixed extents. When you get more
than 8 and rebuild the index it will take those pages and give them their
own extent. Personally I usually don't worry about any fragmentation unless
the number of pages is at least 100. But the rule of thumb in general seems
to be 1000 or more. To me anything between 100 and 1000 will only take a
second to rebuild anyway so I usually set my threshold at 100.

Signature
Andrew J. Kelly SQL MVP
Solid Quality Mentors
> Andrew,
>
[quoted text clipped - 43 lines]
>> >
>> > Thanks!
Michael - 11 Jul 2008 20:09 GMT
Andrew,
Thanks. Wow--1000 pages--I didn't realize the number would be so high.
Your lower number of 100 seems to be a more proactive approach. Do you use
the report "Index Physical Stats" to show you the number of pages?
Thanks,

Signature
Michael Strozzo
SQL DBA
> Anything less than 8 pages will always use mixed extents. When you get more
> than 8 and rebuild the index it will take those pages and give them their
[quoted text clipped - 50 lines]
> >> >
> >> > Thanks!
Andrew J. Kelly - 12 Jul 2008 03:03 GMT
Yes you can get the fragmentation level and number of pages from the same
DMV. In my code that looks for indexes to rebuild or defrag there is always
an optional parameter to ignore any indexes with xx many pages or less. Then
you can programmatically determine this if need be from one index to the
next.

Signature
Andrew J. Kelly SQL MVP
Solid Quality Mentors
> Andrew,
>
[quoted text clipped - 73 lines]
>> >> >
>> >> > Thanks!