Nimish Gupta
06/04/2021, 6:27 PM// Node js
// Fetched a connection from pool. --> (1)
const firstQuery = await prisma.model.find();
// Fetched a connection from pool. --> (2)
const secondQuery = await prisma.model.find();
So 1 and 2 statements are logged while calling these queries. Can you explain why second statement is logged? Prisma should use the same connection (connection used for performing first query), right?janpio
janpio
Nimish Gupta
06/04/2021, 7:39 PMjanpio
janpio
Nimish Gupta
06/04/2021, 7:48 PMNimish Gupta
06/07/2021, 12:26 PMWhen a query comes in, the query engine reserves a connection from the pool to process query.So after the query is executed, does prisma release this connection and again put that connection into the pool? Or it picks a new connection?
janpio
janpio
janpio
janpio
janpio
janpio
janpio
janpio
janpio
janpio
Nimish Gupta
06/07/2021, 3:14 PMjanpio
Nimish Gupta
06/07/2021, 3:51 PMtemporary_table, with second we are inserting into the temporary_table. Temporary tables in postgres remains per session (don't know how sessions are managed in Prisma i.e if session can have multiple connections or not). So kind of second state is dependent on first state.janpio
janpio
Nimish Gupta
06/07/2021, 3:53 PMjanpio
janpio
Nimish Gupta
06/07/2021, 6:06 PM