June 2024
Intermediate to advanced
456 pages
11h 34m
English
Prepared statements[155] are object types in PostgreSQL that separate parameter values from queries. The parameterless variation gets a name and gets stored for future variations where it can be re-used.
In future re-uses, the specific parameters are substituted into the prepared statement parameterless version. This substitution cuts down on some query statement parsing that otherwise happens and adds latency.
View prepared statements in your database using the pg_prepared_statements catalog view. To do that, run SELECT * FROM pg_prepared_statements; from psql. If the results are empty, you don’t have any prepared statements.
Prepared statements are enabled by default in Active Record, storing up to ...
Read now
Unlock full access