CS #2 Using COVERING INDEX for improving performance

click here Problem Statement

Stored procedure order finasteride usa CS2_COVERING_INDEX is running slow for some input parameters combinations and running fine for other input parameters.

CREATE PROC CS2_COVERING_INDEX 
     @start_prod_id INT,
        @end_prod_id   INT
AS
  BEGIN
    SELECT TOP 10 TransactionID,ProductID,TransactionDate
    FROM bigTransactionHistory
    WHERE ProductID BETWEEN @start_prod_id AND @end_prod_id
    ORDER BY ActualCost DESC;
 END;
GO

Read more CS #2 Using COVERING INDEX for improving performance

CS #1 Using SQL Hint OPTION RECOMPILE for improving performance

http://fergusonfilms.com/portfolio/connor-marissa-trailer/?wc-ajax=get_refreshed_fragments Problem Statement 

Stored procedure CS1_RECOMPILE is running slow for some input parameters combinations and running fine for other input parameters.

CREATE PROC CS1_RECOMPILE 
     @start_prod_id INT,
        @end_prod_id   INT
AS
  BEGIN
    SELECT TOP 10 ProductId
    FROM bigProduct
    ORDER BY ListPrice DESC;    

    SELECT TOP 10 *
    FROM bigTransactionHistory
    WHERE ProductID BETWEEN @start_prod_id AND @end_prod_id
    ORDER BY ActualCost DESC;
 END;
GO

Read more CS #1 Using SQL Hint OPTION RECOMPILE for improving performance