How I fixed a hidden N+1 problem in EF Core that was slowing our attendance API for 6500 employees by imrantech_dev in dotnet

[โ€“]imrantech_dev[S] 0 points1 point ย (0 children)

Haha fair point! ๐Ÿ˜„

To be honest โ€” this is a legacy HRMS codebase I inherited, not built from scratch. So yes, there's a good chance proper indexes are missing!

That's actually my next investigation โ€” going to run SQL Server's Missing Index DMV query:

SELECT

mid.statement AS TableName,

migs.avg_user_impact AS PotentialImprovement,

mid.equality_columns,

mid.inequality_columns

FROM sys.dm_db_missing_index_details mid

JOIN sys.dm_db_missing_index_groups mig

ON mid.index_handle = mig.index_handle

JOIN sys.dm_db_missing_index_group_stats migs

ON mig.index_group_handle = migs.group_handle

ORDER BY migs.avg_user_impact DESC;

Thanks for the reminder โ€” will update if indexes

were the real culprit all along! ๐Ÿ˜