If I stop a long running query, does it rollback?

后端 未结 12 1930
忘了有多久
忘了有多久 2020-12-06 04:23

A query that is used to loop through 17 millions records to remove duplicates has been running now for about 16 hours and I wanted to know if the query is sto

12条回答
  •  心在旅途
    2020-12-06 05:04

    As a loop your query will struggle to scale well, even with appropriate indexes. The query should be rewritten to a single statement, as per the suggestions in your previous question on this.

    If you're not running it explicitly within a transaction it will only roll back the executing statement.

提交回复
热议问题