delete last 9 h

  • I have  this query                    DELETE r FROM PBRecord r WITH (ROWLOCK)             WHERE r.pbRecordId = @MinId  OPTION (RECOMPILE);               it last 9 h !!. on powerfull server SQL server 2016 SP2 ,128 GB RAM

    attached execution plan

    please help  me to reduce the time!

    Thanks.,

    Regards,

     

    Hadrian

  • no plan attached

    blocking (open trans) can cause the query run even longer

     

  • Create an index keyed on pbRecordId on that table.

    SQL DBA,SQL Server MVP(07, 08, 09) Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: "If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them."

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply