Re: Partitioning the persistence problem space
hga@xxxxxx 12 Sep 2019 13:12 UTC
Quick reply on the issue of statement performance:
> From: Peter Bex <xxxxxx@more-magic.net>
> Date: Thursday, September 12, 2019 7:45 AM
> On Thu, Sep 12, 2019 at 07:29:17AM -0500, xxxxxx@ancell-ent.com wrote:
>> Hiding the concept of prepared statements...
> In the postgresql egg:
>
> (row-values (query conn "SELECT $1, $2" "hi" "there")) => ("hi" "there")
>
> This is sent in one roundtrip to the database without the use of an
> intermediate prepared statement.
>
> The freetds egg[2] which I co-wrote also does this, but it
> implements it via a hidden prepared statement. That egg does not
> provide a way to create prepared statements directly. That's
> possibly an oversight because creating prepared statements and
> executing them more often can be a performance benefit (it avoids
> parsing the SQL over and over).
>
> I don't know how often this is needed or how big of a benefit it
> really is, though....
I'm under the impression this is less important today because systems
are so much more capable, and long prior to that databases like the
portable version of DB2 introduced caching than can to some degree
alleviate having to repeat parsing and planning.
> [...]
> [2] https://wiki.call-cc.org/eggref/4/freetds
- Harold