I have the following query:
SELECT [t].[Key], SUM([t].[ValueA]), SUM([t].[ValueB]) FROM [MyTable] AS [t] GROUP BY [t].[Key]
This table had an nvarchar column with value lengths of 2000 characters (I think this shoot up the I/O cost). As I didn't need this column in the query, I created a new auxiliary table, and moved this heavy column to make the query faster and update statistics runing:
Update STATISTICS HCJConsumos WITH FULLSCAN
And this improved the performance much more, it takes 6 seconds.
Is it possible to make the database realize that this cost is overestimated without exporting and importing the database, as this makes the query run much faster. Due it is the same data, this must be affecting the execution plan and performance of the query.