postgreSQL query seems to be running on infinite loop
问题 Following my previous question, I am now trying to remove duplicates from my database. I am first running a sub-query to identify the almost identical records (the only difference would be the index column "id"). My table has roughly 9 million records and the below code had to be interrupted after roughly 1h30 DELETE FROM public."OptionsData" WHERE id NOT IN ( SELECT id FROM ( SELECT DISTINCT ON (asofdate, contract, strike, expiry, type, last, bid, ask, volume, iv, moneyness, underlying,