Re: Optimizing massive update to large table

From: Sean Shanny (shannyconsulting_at_earthlink.net)
Date: 10/16/04

  • Next message: Jimbo68k: "SQL Server 2000 backups with SONY DAT drive"
    Date: Sat, 16 Oct 2004 00:11:55 -0400
    
    

    Andrew,

    Thank you very much, that is doing the trick.

    For your info an Apple X-Raid is a low cost, $15K for 3.5TB, IDE fibre
    channel based raid system. We are connected via 2 fibre channels directly
    to the box. Unfortunately we cannot combine the 14 drives at the hardware
    level hence the 2 7 drive raid 5 sets that are then striped at the OS level
    giving us raid 50.

    Our db, which is a warehouse, is running in simple mode so I don't think,
    but could be wrong, that the transaction logs are a big bottle neck. If we
    need to we can put a fibre switch in and throw another X-Raid system in the
    mix to allow faster performance for log writing. We should probably move
    indexes to another disk subsystem as well. To be honest we are extremely
    pleased with the performance of SQL Server so far. Reports that took 20-25
    minutes to run on the old system, exact same hardware, now take 6 minutes,
    only changes in the code dealt with SQL issues like date and string
    functions which are specific to DB vendors.

    I am have a test system at home, same raid box but less drives and I am
    getting about 750k updates an hour which I can deal with. :-)

    Thanks again.

    --sean

    On 10/15/04 10:59 PM, in article eLR7gwysEHA.1272@TK2MSFTNGP12.phx.gbl,
    "Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote:

    > I have no idea what an Apple X-Raid is but striping two Raid 5's at hte OS
    > level does not give me a warm fuzzy feeling<g>. Where is the log file? For
    > optimal performance for larges writes like this you really need it on it's
    > own RAID 1 array. It would help to see the actual DDL for the table
    > including indexes. Are you saying there is no clustered index not even on
    > the PK? Your batches are still probably too high for peak performance with
    > that configuration. Try batches of 10K and if that works move up and see
    > how it goes. Your update statement as is will always update the full amount
    > of rows so your batch commit size is useless. You are probably going to
    > have to use a subselect with TOP or maybe even temp tables. If you had a
    > clustered index on the PK it might be easier but here are some things to
    > try.
    >
    > Make sure that you have a clustered index on wh_tmp_fixed_locations on the
    > ID column.
    >
    > CREATE TABLE #temp ([PKID] INT NOT NULL, [location_key] INT, [content_key]
    > INT, CONSTRAINT ID_PK PRIMARY KEY ([PKID]) )
    >
    > WHILE 1 = 1
    > BEGIN
    > TRUNCATE TABLE #temp
    >
    > INSERT INTO #Temp ([PKID], location_key, content_key )
    > SELECT TOP 10000 b.ID, b.location_key, b.content_key
    > FROM wh_tmp_fixed_locations
    > ORDER BY b.ID
    >
    > IF @@ROWCOUNT = 0
    > BREAK
    >
    > Update pv
    > Set location_key = s.location_key,
    > content_key = s.content_key
    > From f_pageviews pv
    > Join #temp AS s on (pv.id = s.[PKID])
    >
    > DELETE FROM wh_tmp_fixed_locations WHERE id IN ( SELECT [PKID] FROM
    > #temp)
    > END
    >
    > As always test before trying on production.

    -- 
    

  • Next message: Jimbo68k: "SQL Server 2000 backups with SONY DAT drive"

    Relevant Pages

    • Summary : Sun StorEdge A5200 Array
      ... license if you want to use software RAID though. ... If you want Fibre raid, the only Sun solution is the T-3. ... Expandibility is easy (adding additional disks, ...
      (SunManagers)
    • Re: Optimizing massive update to large table
      ... > channel based raid system. ... We are connected via 2 fibre channels directly ... that the transaction logs are a big bottle neck. ... Are you saying there is no clustered index not even ...
      (microsoft.public.sqlserver.server)
    • Re: SAS / SATA RAID to Fibre?
      ... some aspects of fibre commoditized. ... You can certainly get the 1 Gbps ... devices on the server and use a hardware RAID controller. ... We even have a line of inexpensive / white box SAS JBOD enclosures ...
      (comp.arch.storage)
    • 3510 / JNI / V480 / Sol9
      ... I'm having problems with a 3510 RAID box connected by fibre to a V480 server ... running Solaris 9 via a JNI card. ... software is all at the current recommended release and patch level. ...
      (SunManagers)
    • Re: SQL Server 2000 Performance - 10K vs. 15K
      ... Not a lot slower, but still slower -- and you know ... Log files and data files on separate raid ... OS and Log array is RAID 1 on channel 0, ...
      (microsoft.public.sqlserver.setup)