View performance problems

  • 😉 Hello Developers/DBA's,

    We recently upgraded a system and one of the views was updated by a 3rd party software provider we received the db upgrade scripts from. In the scripts they provided us the view has changed as shown below. Since the upgrade we're getting "Server encountered an error" when a user tries to run a transaction report thru the web UI.

    Just an FYI there were also 2 fields that were added to this view that reside in a table over 12+ million rows.

    Anybody have any thoughts??? Your input is greatly appreciated!!! 😀

    Two new fields in the view ---

    dbo.TRX_Header_T.BatchID_VC , dbo.TRX_Header_T.Reversal_Flag_CH -- new fields in the new view (possibly needs an index, what think?)

    old view ---

    dbo.CC_Info_T INNER JOIN

    dbo.TRX_Card_T ON dbo.CC_Info_T.Card_Info_Key = dbo.TRX_Card_T.Card_Info_Key INNER JOIN

    dbo.TRX_Header_T ON dbo.TRX_Card_T.TRX_HD_Key = dbo.TRX_Header_T.TRX_HD_Key LEFT OUTER JOIN

    dbo.TRX_Receipt_T ON dbo.TRX_Header_T.TRX_HD_Key = dbo.TRX_Receipt_T.TRX_HD_Key

    new view ---

    dbo.CC_Info_T INNER JOIN

    dbo.TRX_Card_T ON dbo.CC_Info_T.Card_Info_Key = dbo.TRX_Card_T.Card_Info_Key INNER JOIN

    dbo.TRX_Header_T ON dbo.TRX_Card_T.TRX_HD_Key = dbo.TRX_Header_T.TRX_HD_Key LEFT OUTER JOIN

    (SELECT TRX_HD_Key, COUNT(*) AS TRX_Receipt_Cnt

    FROM dbo.TRX_Receipt_T AS TRX_Receipt_T_1

    GROUP BY TRX_HD_Key) AS TRX_Receipt_T ON dbo.TRX_Header_T.TRX_HD_Key = TRX_Receipt_T.TRX_HD_Key

  • Don't touch a thing. Get that 3rd party vendor on the bloody phone and have them fix it now!

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • While Jeff is likely correct, as usual, what happens if you run the same query in SSMS/Query Analyzer? You will probably get a better error message or might find that the error is in the web UI.

  • You done great in identifying it and yes i would be on the phone too.....after all you pay support they fix it.

    Changing code on vendor software sometimes make it unsupportable...so work with them.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply