I'm having performance problem with Entity Framework while using generic methods for data aggregation. When querying max value of (indexed) Id column of table with few hundred thousands of rows using generic methods I'm getting huge performance drop. I'm using code-generated int keys instead of sql identities, this code is used to get next new Id. I'm having performance problem with Entity Fram