I have a query that is running against a table with 50 million rows. The phone number is stored as a CHAR(10) and an ETL process is changing the phone number if it has certain values. We are seeing poor performance of this query and was wondering if anyone has any suggestions on improving performance. No index currently exists with the phone number.
UPDATE Table SET phone='' WHERE ( phone IS NULL
OR phone = ''
OR phone = '0000000000'
OR phone = '0'
OR phone like '111%'
OR phone like '222%'
OR phone like '333%'
OR phone like '444%'
OR phone like '555%'
OR phone like '666%'
OR phone like '777%'
OR phone like '888%'
OR phone like '999%'
OR phone like '800%'
OR phone like '900%'
)
phone
column, what did you expect?