Home Forums SQL Server 2008 SQL Server 2008 - General facing serious performance issues, please see the scenario below need urgent help - Please chk the code below RE: facing serious performance issues, please see the scenario below need urgent help - Please chk the code below

  • just my 2ct, to add to previous responders replies:

    In your sproc, chances are filter arguments aren't sniffed to your advantage at query plan generation time.

    Reason for that is you are parsing and completing the filter arguments within the sproc itself.

    Try handing there parameters over as needed by the sproc itself.

    i.s. try writing your sproc so it accepts the needed filter data as input paramters and see how that influences the query plan.

    It may even be enough to add 'with recompile' to the detail query ( please implement the grouping and union all advice )

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me