J
jeremy
11 minutes
A parameter is a placeholder in a prepared statement, written $1 or ?, whose value arrives separately when the statement runs. The statement's text never changes, so the same query text serves every value, which is what makes plan reuse possible. The catch is that when the database plans a statement without knowing the value, it has to guess how many rows the condition will keep, and a guess made for an average value can be badly wrong for an unusual one.