I'm performing a query where there is a high probability the row does not exist, but I do want to lock the row via a SELECT FOR UPDATE if it does exist. Would there be any performance hit from SELECT FOR UPDATE right away in the cases where the row doesn't exist?
My use case is on postgres if the DB affects the answer.