Is it more efficient to always run a DELETE query by default whether an entry exists or not, for example to delete a user name after a certain period of time (DELETE * from table WHERE username='user'
), or should you first check if the rows to be deleted exist using a SELECT
query and checking mysql_num_rows
.
What uses more processor resources on the server side?
Obviously one approach contains more code, but I was wondering if certain mysql operations used a lot more CPU than others.