public inbox for [email protected]
help / color / mirror / Atom feedFrom: Adrian Klaver <[email protected]>
To: Daniele Varrazzo <[email protected]>
To: Vladimir Ryabtsev <[email protected]>
Cc: [email protected]
Subject: Re: psycopg3, prepared statements
Date: Wed, 23 Dec 2020 15:12:36 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+mi_8akdCJC=q9_EH5n5Prj32ttLKCY8-=yncxRr7K8V2mZhw@mail.gmail.com>
References: <CA+mi_8aAuORkdXZ9bG_GpU34iPCGktMO83ktn+ODjL+Y=Y=e3Q@mail.gmail.com>
<[email protected]>
<CA+mi_8YoZ6_0NM4TbfqE8SQY8-b=RgaBH-jUVxzbWQdp+4oZGQ@mail.gmail.com>
<[email protected]>
<CAMqTPq=G1E=b32JxNo6dGk1-9qGHSCP7Puo5FCqf68nakiBo_Q@mail.gmail.com>
<CA+mi_8YhQVo8xouWnc6hCR6RvE1THRB0Wz0OzHhMHsuvdLNYnw@mail.gmail.com>
<CA+mi_8akdCJC=q9_EH5n5Prj32ttLKCY8-=yncxRr7K8V2mZhw@mail.gmail.com>
On 12/23/20 2:53 PM, Daniele Varrazzo wrote:
> On Tue, 22 Dec 2020 at 22:36, Daniele Varrazzo
> <[email protected]> wrote:
>>
>> On Tue, 22 Dec 2020 at 05:39, Vladimir Ryabtsev <[email protected]> wrote:
>
>
> Heads up about this: it's better than I thought!
>
> I wrote a first implementation of the prepared statements cache using
> the query as a key, but it's actually enough to use the (query, types)
> tuple in order to tell apart statements that are executed with
> different types. This way even the "SELECT %s" case won't be a
> problem. Of course a statement executed with a mix of types will be
> prepared later than `prepare_threshold`, but I think it's perfectly
Alright I was following you until you got to above. I'm not following
why it would overshoot prepare_threshold?
> acceptable: the case doesn't happen often and having the query
> prepared after 10 times instead of 5 doesn't change much if it will be
> executed hundreds of times or more.
>
> What seems a feature-complete branch is available in [1]. The tests
> [2] illustrate the main behaviour of the prepared statements system.
>
> [1]: https://github.com/psycopg/psycopg3/tree/prepared-statements;.
> [2]: https://github.com/psycopg/psycopg3/blob/prepared-statements/tests/test_prepared.py
>
> Off to do some benchmarks now...
>
> -- Daniele
>
--
Adrian Klaver
[email protected]
view thread (13+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: psycopg3, prepared statements
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox