Re: Parameterized prepared statements

Поиск
Список
Период
Сортировка
От Dmitriy Igrishin
Тема Re: Parameterized prepared statements
Дата
Msg-id CAAfz9KME5rCjWc4TgGns=87PJgh9t0p8bpcs4Gwf0rrR6j0uzw@mail.gmail.com
обсуждение исходный текст
Ответ на Parameterized prepared statements  (Craig Ringer <ringerc@ringerc.id.au>)
Список 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 по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Parameterized prepared statements
Следующее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: CentOS 6 - www.pgrpms.org - SELinuxi dn