Has somebody ever run a test to measure time differences of queries like:
SELECT foo FROM bar WHERE id=’$id’
SELECT foo FROM bar WHERE id=$id
assumed that column id is an integer?
What i would like to know is how mutch these ‘…’ influence the evaluation. I bet there is some difference (some CPU cycles needed for the string-to-integer cast) and i guess that it is really small compared to the time needed for seeking, ordering, joining, etc…
Nevertheless it could be interesting to know. Maybe the difference would be bigger when several expressions are combined like:
SELECT foo FROM bar WHERE a=’$a’ AND b=’$b’ AND c=’$c’ AND d=’$d’
SELECT foo FROM bar WHERE a=$a AND b=$b AND c=$c AND d=$d
Anybody who can offer some statistics?