B
B
beduin012020-06-06 16:05:39
PostgreSQL
beduin01, 2020-06-06 16:05:39

How important is the prepare query in the database now?

Reading about PG.
PQprepare creates a prepared statement for later execution with PQexecPrepared. This feature allows commands that will be used repeatedly to be parsed and planned just once, rather than each time they are executed.

Question. Now optimizers are all smart and cache it all. How many prepared requests are needed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Grass_hopper, 2020-07-26
@Grass_hopper

Prepared statements exist within the session, not within the transaction. But there may be nuances. If you connect to the database through a connection pool. In this case, you need to know how the pool is configured: whether it uses one connection during the entire session or only during the transaction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question