'Is this DELETE query ok or poorly constructed

My company uses a product that uses MySQL 5.5 (innodb based) for backend alarm and data logging. Our larger installations, dbase tables >= 25G, are constantly having issues related to dbase operations. I have found many issues with their dbase related logic in the past and recently captured the following query, but before I pass judgment on the quality of this query I wanted to get feedback from the community. I am NOT a dbase expert in any way but this query look horrible to me, what do you all think.

DELETE FROM table WHERE
((iStatus < 0 AND dtFirst < '2021-04-12 12:43:00') OR 
(iStatus = 5 AND dtFirst < '2022-03-13 12:43:00') OR 
(iStatus = 60 AND dtFirst < '2021-04-12 12:43:00') OR
(iStatus = 120 AND dtFirst < '2021-04-12 12:43:00')) 
AND iId NOT IN (List of thousands of IDs)

My issue is with the last NOT IN list of items. I have captured queries where this list contains 50K to 75K items, and no this is not a typo. The list actually has contained 75 thousand indexes. Am I incorrect in assuming that this is a very poor query that could cause all sorts of performance issues? I don't have the experience to pass judgment here so I defer to you experienced database experts.

Thanks in advance for any feedback.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source