Re: Adding columns to SQL Server tables dynamically

From: Sahil Malik (contactmethrumyblog_at_nospam.com)
Date: 12/05/04


Date: Sat, 4 Dec 2004 21:16:45 -0500

I couldn't agree more with you on the below, and I can't say I haven't
learnt anything from your very patient replies.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik

"David Browne" <davidbaxterbrowne no potted meat@hotmail.com> wrote in
message news:%23L3I6Wl2EHA.1392@tk2msftngp13.phx.gbl...
>
> "Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
> news:%23WE4yqj2EHA.936@TK2MSFTNGP12.phx.gbl...
>> David,
>>
>> So would you recommend a production app to add columns through ado.net
>> sqlcommands? In other words; is it okay to have a production application
>> add columns on the fly to the database, in addition to
>> select/update/delete statements? I always thought that was not a
>> recommended practise precisely because you'd have to run DBCC DBREINDEX
>> on your production servers more frequently.
>>
>
> I wouldn't want to see columns added nearly as frequently as
> select/update/delete. But for, say, daily import job it isn't a very big
> deal, especially if the you only insert new rows with the added columns,
> not update existing rows. New nullable columns are really free to add:
> it's like they were there the whole time, but null on all existing rows.
> Mass updates which significantly increase the size of the target rows will
> cause page splits, and will take a long time.
>
> It really depends on the frequency of the changes and the size of the
> table. If the table has 100 million rows, then I would never ALTER it
> except over the Christmas holiday. For any table under a million rows,
> it's just not a big deal. And for any Sql Server whose active database is
> smaller than the amount of ram dedicated to Sql Server, it's just not a
> big deal, since Sql Server index fragmentation only really affects disk
> throughput.
>
> "Back in the day", say 1995, RAM sizes were much smaller, and disk access
> was relatively faster. Database servers used _much_ more physical IO than
> they do these days. Any issue affecting physical IO throughput went right
> to the bottom line of server performance.
>
> For instance you might have 4 100 mhz Pentium processors, 128 megs of ram
> accessed across a 33mhz bus, and 20gigs of storage spread among 10 hard
> drives. The hard drives were almost half as fast as todays drives, and
> the large number of spindles probably made up for it. But the RAM was 10x
> slower and 10x smaller, and the CPU was 30x slower. In addition to log
> flushing, any query of any size, most sorts, and many DML operations
> required really significant physical IO.
>
> Compare that with a low-end server today. 2 cpu's at 3.4ghz 2gigs of ram
> on the other end of an 800mhz memory bus, and 2 35gig SCSI drives in a
> mirror. It's not just that today's machine is faster, it's a different
> kind of machine: it's a machine where you only touch the disks when you
> need to push something to non-volatile storage. It's not that it's so
> fast that you don't have performance problems: you just have different
> performance priorities.
>
> David
>



Relevant Pages

  • Re: SQL 2005 Best Practice vs SQL 2000: Application Files Separate from data (and log) files
    ... Our san guy is ... completely forget about is that moving the head on the disk is the slowest ... the drives that were being assigned to the SQL machine. ... I mean the binn folder which contains the sql server executable among ...
    (microsoft.public.sqlserver.setup)
  • Re: SQL 2005 Best Practice vs SQL 2000: Application Files Separate from data (and log) files
    ... choice to install sql server binaries of the SQL Server on C drive, ... appears that I am not given the choice to install system databases/log files ... drives must be physically seperated so that you'll gain performance ... We are physically separating log and data files on separate disks. ...
    (microsoft.public.sqlserver.setup)
  • Re: SQL 2005 Best Practice vs SQL 2000: Application Files Separate from data (and log) files
    ... button in the "Components to Install" window in SQL Server 2005 Setup. ... In 2005 I appear not to be given the choice to install sql server binaries of the SQL Server on C drive, it appears that I am not given the choice to install system databases/log files on a separate drive, as I could in 2000. ... If it's being used intensively in your environment then you should locate it's log and data files on different physical disks. ... Of course these drives must be physically seperated so that you'll gain performance benefits. ...
    (microsoft.public.sqlserver.setup)
  • Re: SQL 2005 hardware recommendations
    ... If I opted for purchasing six 36 GB drives, I could use four to make a "RAID ... partitions and sizes for the installation of SQL Server 2005 ... I also have the opportunity to purchase the same machine with three 72GB ... I'd make one mirrored pair with a hot spare. ...
    (microsoft.public.sqlserver.setup)
  • Re: Spread table.
    ... You create a new filegroup with 3 files in it. ... the 3 drives. ... it sql server will spread the data evenly across the 3 files. ... >> multiple files unless each file is on a separate drive array. ...
    (microsoft.public.sqlserver.clients)