Re: Create Indexes & extra columns!

From: David G. (david_nospam_at_nospam.com)
Date: 08/25/04


Date: Wed, 25 Aug 2004 01:39:59 -0400

Jonas Larsen wrote:
> Hi guys
>
> 2 questions.
>
> Is it recomenable to create
> 1. Indexes
> 2. extra columns
>
> on a table while the database is being used?
>
> I have not yet had the guts to do it while the database was in use
> however it would be somewhat easier if I could?
>
> Regards
> Jonas

Recommended is a loaded word. You can certainly perform both operations
while users are accessing the database. Adding a column should be quick
as long as you don't have to load data into the new column. Adding an
index is a more time consuming process if the table is large. If you
create a clustered index, you'll likely take the table offline until the
operation is complete and all non-clustered indexes are rebuilt.

If you are concerned about affecting the availability of the table in
question, schedule the operation to take place at night using the SQL
Server Agent.

-- 
David G.


Relevant Pages

  • UniqueIdentifier, offline data: clustering key choice? ... (indexing+performance question)
    ... Say if you have two customer databases, ... When putting them onto the synchronised database you would ... >clustered index, but again: ... >The identifier column, of course, would be thrown away ...
    (microsoft.public.sqlserver.programming)
  • UniqueIdentifier, offline data: clustering key choice? ... (indexing+performance question)
    ... Central SQL Server database with multiple tables holding millions ... UniqueIdentifier as a surrogate key to ensure that I have a simple ... and a dozen non-clustered indexes on each table). ... clustered index, but again: A general mechanism would be preferred. ...
    (microsoft.public.sqlserver.programming)
  • Re: DBCC DBREINDEX and FillFactor
    ... > you database objects. ... Actually a Shrink operation will fragment the objects not defrag. ... > data page and leave 10% as free space for future growth. ... A non clustered index is simply implemented behind the scenes as a table ...
    (microsoft.public.sqlserver.server)
  • Re: DBCC DBREINDEX and FillFactor
    ... file (log file) instead of somewhere around 10% increase. ... >> you database objects. ... > Actually a Shrink operation will fragment the objects not defrag. ... > A non clustered index is simply implemented behind the scenes as a table ...
    (microsoft.public.sqlserver.server)
  • Re: DBCC DBREINDEX and FillFactor
    ... Andrew J. Kelly SQL MVP ... >>> you database objects. ... >> Actually a Shrink operation will fragment the objects not defrag. ... >> A non clustered index is simply implemented behind the scenes as a table ...
    (microsoft.public.sqlserver.server)