Forum Replies Created

Viewing 15 posts - 511 through 525 (of 5,841 total)

  • RE: Let the optimizer do it's thing -- wrong

    Indianrock (12/16/2016)


    Regarding the modifications Lynn Pettis made to the OP query. I attached the plan.

    ------LYNN PETTIS CHANGE

    -- 92 rows in QA in 03:29 first run 10...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Let the optimizer do it's thing -- wrong

    Lynn Pettis (12/14/2016)


    TheSQLGuru (12/14/2016)


    You may have missed it Lynn, but this is an ORM app. I doubt very much it is going to be reworking that query much at all,...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Let the optimizer do it's thing -- wrong

    You may have missed it Lynn, but this is an ORM app. I doubt very much it is going to be reworking that query much at all, almost certainly not...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: calling stored procedure in a loop and selecting from results

    Lynn Pettis (12/14/2016)


    junk.mail291276 (12/14/2016)


    Hello,

    I have a stored procedure that takes a project ID as a parameter and returns a list of results on that project. Now what I'd like to...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Long running insert

    If you go henriksen's route, a potentially nice improvement would be to substring the field used in this JOIN as you populate table #b:

    ON a.dim_1 = SUBSTRING( b.dim_value, 1, 2...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: SSMS database usage report - unused space

    Easy way to get back a bunch of GBs of free space, eh??

    Now, you did NOT shrink the database, right?!?! :hehe:

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Random number generation based on condition

    Indeed there will need to be something (which is definitely not shown) that provides guaranteed order of IDs 1, 2 and 3 as you have it.

    Also, you REALLY should...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Long running insert

    Oh, there is WAY more wrong with this query (from an optimization standpoint) than just a lot of substrings. At least for those you can replace them with LIKE for...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Let the optimizer do it's thing -- wrong

    patrickmcginnis59 10839 (12/14/2016)


    Indianrock (12/13/2016)


    hijacked thread 🙂

    we are altering the thread. pray we do not alter it any further.

    HAH!! :hehe:

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Help with Query to Look at the list and return repeated value if condition is met

    You could add something like this to your WHERE clause:

    AND EXISTS (SELECT * FROM ... WHERE ... "they shopped in Men's")

    AND EXISTS (SELECT * FROM ... WHERE ... "they shopped...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Let the optimizer do it's thing -- wrong

    patrickmcginnis59 10839 (12/13/2016)


    TheSQLGuru (12/13/2016)


    A) Regarding index reorg, I don't think you get "random crap in your database" because of it while running NOLOCK SELECTs. You may get committed bad data...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Let the optimizer do it's thing -- wrong

    patrickmcginnis59 10839 (12/13/2016)


    Alan.B (12/9/2016)


    Indianrock (12/9/2016)


    I've heard this advice everywhere. Don't do things to change the way the sql optimizer produces plans etc. "it's smart so don't use plan...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Generate Deadlock Summary Information

    Carolyn Richardson (12/13/2016)


    We are fortunate enough to have a well over-specked server in a non 24/7 operation so I don't have to worry about running jobs like this out of...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: GROUP BY in SQL Server 2014

    PLEASE understand that ORDER BY is a HEAVY TEMP OPERATION and should ABSOLUTELY be avoided unless there is a defined requirement for the particular order (AND it isn't small set...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: SSMS database usage report - unused space

    JarJar (12/13/2016)


    no clustered index. it's a vendor application. would putting a clustered index on it fix this usused space issue?

    thanks again.

    Yep, but it...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 15 posts - 511 through 525 (of 5,841 total)