• Lowell (6/25/2013)


    I think one of the join criterias are using scalar functions though...i think that is the performance killer here:

    isn't this three different scalar functions being used to create the joins??

    [dbo].[tipo_id_std]()

    [dbo].[get_release_id]()

    [dbo].[skus_min_drel]()

    Mmm, you're right, Lowell. I didn't even notice that amongst the lack of aliases and the square brackets. I agree: this is what's hurting performance, not the index not being used.

    Marco, scalar functions are bad for performance because they have to be executed for each row, and because they make the clause non-SARGable, which means that any index on the columns in question will (probably) not be able to be used.

    John