Forum Replies Created

Viewing 15 posts - 166 through 180 (of 309 total)

  • RE: Updating 20M rows takes 5 hours

    ss-457805 (5/19/2010)


    Hi Jeff

    In such a case, disabling the clustered index would keep that huge amount of disk overhead from occuring.

    By disabling the clustered index, won't the update statement error....

  • RE: Updating 20M rows takes 5 hours

    Dont worry about the clustered index. It should not be disabled.

  • RE: Updating 20M rows takes 5 hours

    ss-457805 (5/19/2010)


    I followed the below method:

    1) Use SELECT INTO to create a new table with the correct content by joining the two involved tables.

    2) Drop the old table

    3) rename the...

  • RE: Updating 20M rows takes 5 hours

    ss-457805 (5/19/2010)


    Hi Stefan

    i followed our steps.

    The actual update is only taking 2 minutes. But creating the indexes takes 12 minutes. So in total around 14 minutes. Not a lot improvement...

  • RE: Non Cllustered Index - Composite vs Include Columns

    You should only use the composite version if you actually perform seeks or joins on all three columns just as you said.

    In all other cases you should use include.

    Include is...

  • RE: Updating 20M rows takes 5 hours

    ss-457805 (5/18/2010)


    Updated 2.6 Million rows.

    Total number of rows in productionaudit is 2.6 million. This is the test environment. In the live production the number of rows is >20Millions

    So, if I...

  • RE: Transpose Columns to Rows

    Did you try my query ?

    It works for me. 😎

  • RE: Updating 20M rows takes 5 hours

    ss-457805 (5/18/2010)


    Hi Stefan

    I just diabled all the non clustered indexes and ran the update. It took 8 minutes. It is still more than the one i tested using Select *...

  • RE: SP vs isolated code.

    Most likely because of parameter sniffing.

    When compiling a stored procedure the SQL server creates an execution plan that is optimal for the parameters specified when the procedure was first run.

    It...

  • RE: Updating 20M rows takes 5 hours

    ss-457805 (5/18/2010)


    PLease let me know if adding proper indexes can resolve this.

    Adding more indexes will not solve the problem.

  • RE: Transpose Columns to Rows

    sharmadipak (5/17/2010)


    I have tried replicating the code below but that didn't worked 🙁

    I hope this will work:

    select

    [2_Org_Code], [2_Org_Name], [3_Org_Code], [3_Org_Name], [YEAR], [Serial No], [Serial_Name], [Serial_Sub_No], [Serial_Sub_Name], [NC], [NC_Description],

    'A'+c as...

  • RE: Updating 20M rows takes 5 hours

    ss-457805 (5/17/2010)


    I suppose i can drop the indexes, run the update 2Million rows at a time, and then recreate the indexes. But is this the correct way to do it.

    Yes,...

  • RE: Databse Performance Issue

    Look at the actual execution plans on your local box and on the server. There should be a clear difference.

    This will probably tell you what the problem is.

    If you...

  • RE: Partial Clustered Index Seek then Merge Join...

    J-F Bergeron (5/17/2010)


    I did not realize the key lookup was that long to do, I don't know the internals of a key lookup, but I'm surprised it's longer to do...

  • RE: Transpose Columns to Rows

    Something like this perhaps:

    create table #t (

    id int identity(1,1),

    AJAN int,

    AFEB int,

    AMAR int,

    FJAN int,

    FFEB int,

    FMAR int

    )

    insert into #t (AJAN,AFEB,AMAR,FJAN,FFEB,FMAR) values (1,2,3,4,5,6)

    insert into #t (AJAN,AFEB,AMAR,FJAN,FFEB,FMAR) values (11,12,13,14,15,16)

    select * from...

Viewing 15 posts - 166 through 180 (of 309 total)