SQL - improve NOT EXISTS query performance

前端 未结 7 1829
名媛妹妹
名媛妹妹 2021-02-07 09:08

Is there a way I can improve this kind of SQL query performance:

INSERT
INTO ...
WHERE NOT EXISTS(Validation...)

The problem is when I have ma

7条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-07 09:43

    If you can at all reduce your problem space, then you'll gain heaps of performance. Are you absolutely sure that every one of those rows in that table needs to be checked?

    The other thing you might want to try is a DELETE InsertTable FROM InsertTable INNER JOIN ExistingTable ON before your insert. However, your mileage may vary

提交回复
热议问题