Does appended LIMIT 1 after query have any performance boost?
…if there could be only one possible entry that matched (WHERE clause for primary key)?
SELECT `x`
FROM `unicorns`
WHERE `id` = 123
LIMIT 1
…the same, but now it’s DELETE:
DELETE FROM `unicorns`
WHERE `id` = 123
LIMIT 1
…and UPDATE:
UPDATE `unicorns`
SET `rainbows` = `rainbows` + 1
WHERE `id` = 123
LIMIT 1
P.S. Column id is primary key so it’s unique.
Thanks in an advice!
it depends do you have index on column or not
is pointless if id is Primary Key, but
will give u perfomance boost