Forum Replies Created

Viewing 15 posts - 9,691 through 9,705 (of 49,552 total)

  • RE: I need to delete 20 million rows from a table...

    Siberian Khatru (3/13/2014)


    what exactly is the difference between the two types of logging in SQL Server? Is it simply row by row logging versus page level logging, or is...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: OPTION(RECOMPILE)

    As with all hints, use sparingly, only where needed and only after understanding exactly why the hint is needed. It's not something to dump onto every single statement.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Best way to store top 1 record of a table to reduce lookup

    jbonavita (3/12/2014)


    If I stick with the trigger, will this slow down the actual insert or update

    Yes. Whether it will be a noticable slow down is another matter. Test!

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Reset memory cache for query tuning?

    Jeff Moden (3/12/2014)


    Using "Statistics TIME, IO" will also be way off if there are any non iTVF functions in the mix.

    IO will be. Time, if you look at the final...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: I need to delete 20 million rows from a table...

    Jeff Moden (3/12/2014)


    Yes... according to MS definitions... which I happen to disagree with and only because they cause so much confusion. 😉

    According to how things behave. Adding a third category...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: I need to delete 20 million rows from a table...

    Jeff Moden (3/12/2014)


    GilaMonster (3/12/2014)


    MyDoggieJessie (3/12/2014)


    TRUNCATE will be faster and be minimally logged.

    Fully logged. It's efficiently logged, but it is fully logged, not minimally logged. Minimally logged has a specific definition.

    I...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Best way to store top 1 record of a table to reduce lookup

    MyDoggieJessie (3/12/2014)


    Sorry, I meant that if the column he's looking to find is a part of/ or is the clustered index, then the structure of the data is already sorted,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: SQL Server 2008 R2

    Grace09 (3/12/2014)


    Other SQL Servers (same version) all have the min server memory setting changed to 1 GB, that's why I wonder if I should change mine too.

    Maybe find out...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Best way to store top 1 record of a table to reduce lookup

    Have you tested the query option? Does it execute in acceptable time?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: I need to delete 20 million rows from a table...

    About that. There will be other pages (allocation pages) which get deallocated as well, there will be some metadata changes which get logged, but close to that.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: SQL Server 2008 R2

    Not just for the sake of changing it, no.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: I need to delete 20 million rows from a table...

    karthik.bj (3/12/2014)


    But however if you see a need to roll back, use delete. DELETE LOGS ALL NECESSARY DATA FOR ROLLBACK and occupies space.

    So does truncate. Truncate can be rolled...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: I need to delete 20 million rows from a table...

    Truncate logs a lot less than delete. It doesn't log the full page images as it doesn't need to. It logs the same amount as a drop table does, just...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: I need to delete 20 million rows from a table...

    MyDoggieJessie (3/12/2014)


    TRUNCATE will be faster and be minimally logged.

    Fully logged. It's efficiently logged, but it is fully logged, not minimally logged. Minimally logged has a specific definition.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Transfers objects from one database to a named schema in another database

    Generate the table scripts and change the schema name afterwards. Then use something like bcp, SSIS or straightforward INSERT ... SELECT to move the data.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 9,691 through 9,705 (of 49,552 total)