Respect your server's SQL cache
Optimised Access Plan etc. is cached within the server
- keyed by the exact original SQL string used
-
Without placeholders, SQL string varies each time
- so cached one is not reused
- and time is wasted creating a new access plan
- the new statement and access plan are added to cache
- so the cache fills and other statements get pushed out
-
Compare do("insert … $id");
with do("insert … ?", $id);