Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #297

Re: SQL Server 2008 R2 - Reorganize Index taking too long

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: SQL Server 2008 R2 - Reorganize Index taking too long
Date Fri, 06 May 2011 23:49:31 +0200
Organization Erland Sommarskog
Lines 25
Message-ID <Xns9EDDF25D9A4A8Yazorman@127.0.0.1> (permalink)
References <8c0611f4-0dd5-42b5-babf-61bc3610f30d@x1g2000yqb.googlegroups.com> <Xns9EDD819F48961Yazorman@127.0.0.1> <pib8s6husomscer2hid78mln5hhvhhr1al@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 8bit
Injection-Info mx03.eternal-september.org; posting-host="DD6dU+BfJNjsjSP4/K/V7w"; logging-data="12241"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kzdNoPsVNF427oWcJ+hqI"
User-Agent Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32)
Cancel-Lock sha1:z5sr1+ZwjjLCkPd1TN2b+9pYbIY=
Xref x330-a1.tempe.blueboxinc.net comp.databases.ms-sqlserver:297

Show key headers only | View raw


Gene Wirchenko (genew@ocis.net) writes:
> On Fri, 6 May 2011 10:44:32 +0000 (UTC), Erland Sommarskog
><esquel@sommarskog.se> wrote:
> 
>>Reorganisation uses a kind of bubble-sort algorithm, and in some situation 
>>it can take some time to handle a fairly small amount of fragmentation.
> 
>      Bubble sort?  Why?
 
It may not be exactly bubble-sort. But what happens is that SQL Server
swaps place of two pages at a time. The advantage with this is that
REORGANIZE can be an online operation. But it may not always be the 
most efficient.

REBUILD means a complete rebuild of the index, but this means that the
table is unaccessible while the rebuild is running. (Although, in
Enterprise Edition it is possible to do online rebuilds.) 

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

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

SQL Server 2008 R2 - Reorganize Index taking too long SGoncalves <goncalves.sergiom@gmail.com> - 2011-05-06 02:09 -0700
  Re: SQL Server 2008 R2 - Reorganize Index taking too long Erland Sommarskog <esquel@sommarskog.se> - 2011-05-06 10:44 +0000
    Re: SQL Server 2008 R2 - Reorganize Index taking too long SGoncalves <goncalves.sergiom@gmail.com> - 2011-05-06 06:59 -0700
    Re: SQL Server 2008 R2 - Reorganize Index taking too long Gene Wirchenko <genew@ocis.net> - 2011-05-06 10:23 -0700
      Re: SQL Server 2008 R2 - Reorganize Index taking too long Erland Sommarskog <esquel@sommarskog.se> - 2011-05-06 23:49 +0200
        Re: SQL Server 2008 R2 - Reorganize Index taking too long SGoncalves <goncalves.sergiom@gmail.com> - 2011-05-09 03:00 -0700
          Re: SQL Server 2008 R2 - Reorganize Index taking too long Erland Sommarskog <esquel@sommarskog.se> - 2011-05-09 23:59 +0200
            Re: SQL Server 2008 R2 - Reorganize Index taking too long SGoncalves <goncalves.sergiom@gmail.com> - 2011-05-10 03:44 -0700
              Re: SQL Server 2008 R2 - Reorganize Index taking too long Henk van den Berg <hvandenberg@xs4all.nl> - 2011-05-10 12:51 +0200
                Re: SQL Server 2008 R2 - Reorganize Index taking too long Henk van den Berg <hvandenberg@xs4all.nl> - 2011-05-10 12:53 +0200
              Re: SQL Server 2008 R2 - Reorganize Index taking too long Erland Sommarskog <esquel@sommarskog.se> - 2011-05-10 23:36 +0200
                Re: SQL Server 2008 R2 - Reorganize Index taking too long SGoncalves <goncalves.sergiom@gmail.com> - 2011-05-11 03:22 -0700

csiph-web