How optimal is it to create an index for the fields used in the WHERE of the UPDATE and DELETE statements? I have researched on the subject and in general I find split opinions, in general the penalty is mentioned for all the sentences that are not SELECT when creating indexes due to the fact of having to update / create an index for each record, that I understand, without However, opinions are divided when speaking of the use of said index in the WHERE clause of both DELETE and UPDATE:
DELETE FROM mitabla
WHERE miCampoIndexado = 123;
UPDATE miTabla
SET column1 = value1
WHERE miCampoIndexado = 456;
Because in this particular case the search would be performed by an indexed field (Similar to the search in the SELECT), the INSERT would be harmed in any way since it does not use said clause.