Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^8: Best practices for closing database connections?

by erix (Prior)
on Jun 16, 2022 at 09:56 UTC ( [id://11144794]=note: print w/replies, xml ) Need Help??


in reply to Re^7: Best practices for closing database connections?
in thread Best practices for closing database connections?

For placeholders, here's my take.
   1. Efficiency? I doubt that you'd ever spot a difference

You may not spot a difference with a single query if processing time is less than a millisecond but when repeated, you do notice.

On one local postgres server (version 15 beta 1), when I compare queries with placeholder versus hard-coded, the placeholder variant is consistently 2 to 3 times faster. (I think the main reason must be that the PREPARE needs only to run once.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11144794]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-28 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found