Re: Parameterized prepared statements - Mailing list pgsql-general

From Dmitriy Igrishin
Subject Re: Parameterized prepared statements
Date
Msg-id CAAfz9KME5rCjWc4TgGns=87PJgh9t0p8bpcs4Gwf0rrR6j0uzw@mail.gmail.com
Whole thread Raw
In response to Parameterized prepared statements  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-general
Hey Craig,

Things like pre-parsed prepared statements that're re-planned on every execution are often proposed as solutions to this. This has me wondering: rather than expensively re-planning from scratch, would it be possiblet to adjust the planning process so that *multiple* alternative plans would be cached for a query, using placeholders for unknown rowcounts and costs? At execution, the unknown costs would be filled in and the plans compared then the best plan picked for this execution. Is this crazy talk, or could it significantly reduce the cost of re-planning parameterized prepared statements to the point where it'd be worth doing by default?
Its a good suggestion of some kind of optimization at the server side.
This idea can be extended to an "auto-prepare" mode (like an auto-commit
mode that we have today in Postgres).
But its not so hard to let the application (or library) to decide what to use in
different cases: prepared statement or regular statement. Thus, I think it is
not worth it...

--
Craig Ringer

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
// Dmitriy.


pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Parameterized prepared statements
Next
From: Devrim GÜNDÜZ
Date:
Subject: Re: CentOS 6 - www.pgrpms.org - SELinuxi dn