Re: Odd query execution behavior with extended protocol

Поиск
Список
Период
Сортировка
От Shay Rojansky
Тема Re: Odd query execution behavior with extended protocol
Дата
Msg-id CADT4RqAojc_h2m81Ax5MfwtPaYMW2=v02j8pda=Wi8cZ=LtsHQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Odd query execution behavior with extended protocol  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
<div dir="ltr">Thanks for the help Tom and the others, I'll modify my sequence and report if I encounter any further
issues.</div><divclass="gmail_extra"><br /><div class="gmail_quote">On Sun, Oct 4, 2015 at 7:36 PM, Tom Lane <span
dir="ltr"><<ahref="mailto:tgl@sss.pgh.pa.us" target="_blank">tgl@sss.pgh.pa.us</a>></span> wrote:<br
/><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span
class="">ShayRojansky <<a href="mailto:roji@roji.org">roji@roji.org</a>> writes:<br /> >> To my mind there
isnot a lot of value in performing Bind until you<br /> >> are ready to do Execute.  The only reason the
operationsare separated<br /> >> in the protocol is so that you can do multiple Executes with a row limit<br />
>>on each one, to retrieve a large query result in chunks.<br /><br /> > So you would suggest changing my
messagechain to send Bind right after<br /> > Execute, right? This would yield the following messages:<br /><br />
>P1/P2/D1/B1/E1/D2/B2/E2/S (rather than the current<br /> > P1/D1/B1/P2/D2/B2/E1/C1/E2/C2/S)<br /><br /> >
Thiswould mean that I would switch to using named statements and the<br /> > unnamed portal, rather than the current
unnamedstatement<br /> > and named portals. If I recall correctly, I was under the impression that<br /> > there
aresome PostgreSQL performance benefits to using the<br /> > unnamed statement over named statements, although I
admitI can't find any<br /> > documentation backing that. Can you confirm that the two<br /> > are equivalent
performance-wise?<br/><br /></span>Hmm.  I do not recall exactly what performance optimizations apply to<br /> those
twocases; they're probably not "equivalent", though I do not think<br /> the difference is major in either case.  TBH I
wasa bit surprised on<br /> reading your message to hear that the system would take that sequence at<br /> all; it's
notobvious that it should be allowed to replace a statement,<br /> named or not, while there's an open portal that
dependson it.<br /><br /> I think you might have more issues with lifespans, since portals go away<br /> at commit
whereasnamed statements don't.<br /><br />                         regards, tom lane<br /></blockquote></div><br
/></div>

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: ON CONFLICT issues around whole row vars,
Следующее
От: Andres Freund
Дата:
Сообщение: Re: ON CONFLICT issues around whole row vars,