• you missed the point about entity framework.
    the EF DBContext probably has fifty tables or more inside.

    It's absolutely possible/probable, that because the context is using a big transaction update lots of stuff, even though your core table has 128 rows, it is joined to the other fifty tables, even though they are not needed for the query. you have to run a profile or extended event to capture the actual query generated, and not the visual one you can do by looking at the tables that are only in that procedure..
    that is where you will see the other fifty tables appended to what should be a simple query

    the typical fix is to take that query away from entity framework and put it in a procedure,a nd have the framework call a procedure instead, or create a smaller, lighter context that has fewer tables for that portion of the code.

    I've seen this plenty of times, EF is Ok for 90% of the code, but 10% needs a DBA to fix a few outliers like this.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!