• Steve Jones - SSC Editor - Monday, December 4, 2017 9:22 AM

    It would be good to see more information, even mocked up.

    Is amount used in other queries, or in WHERE/HAVING/ON clauses? If so, then adding it to the index itself can help. If it's used in other queries for calculations or display, then the INCLUDE might be helpful. In terms of removing the RID, this would do it at the expense of more data in the index, either as a column or the include. If there is ordering needed, then the values might be better in the index (sorted), but if not, then include is fine.

    You'll have to test this in a few ways. You might read this as well: https://sqlperformance.com/2014/07/sql-indexes/new-index-columns-key-vs-include

    Hi Steve, with all due respect, I will not be able to provide any query plan for some reasons.

    The query aggregates amount for four columns for a month. The table contains data for 10 years. This table joins with 8 other tables. All the columns used in join as well as select query are in index. However the amount is not. Should I include the amount column in the index itself or with INCLUDE ? this table gets populated continuously during the day by some users. Only insert happens on this table and no delete or update.