Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^5: Dynamic SQL

by bitingduck (Chaplain)
on Apr 06, 2015 at 17:16 UTC ( [id://1122585]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Dynamic SQL
in thread Dynamic SQL

If each prepared statement is used only once then, no, it won't be true. If each prepared statement is used a number of times then it will save the parsing time of the SQL queries each time a prepared statement is reused. The OP has given very limited examples and no sense of the number of possible unique (modulo the values that would go in the placeholders) queries

Replies are listed 'Best First'.
Re^6: Dynamic SQL
by erix (Prior) on Apr 06, 2015 at 17:21 UTC

    If each prepared statement is used only once then, no, it won't be true.

    for instance.

    And then there is the fickleness of planning.

    But I can see it would be hard to set up a broad, convincing case.

      This is generally the case with any caching or memoizing strategy: if the cached results are never re-used, then caching is an overhead. But still, there are many many cases where caching really make sense, it can sometimes transform a quadratic (and sometimes even exponential) algorithm into a linear one. Sometimes it is easy enough to analyze to figure out; in other cases, only benchmark can tell.

      Je suis Charlie.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-03-28 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found