Re: pgin.tcl pg_exec_prepared slow (was: Released...) - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: pgin.tcl pg_exec_prepared slow (was: Released...)
Date
Msg-id 739.1089418076@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgin.tcl pg_exec_prepared slow (was: Released...)  (L J Bayuk <ljb220@mindspring.com>)
Responses Re: pgin.tcl pg_exec_prepared slow (was: Released...)
List pgsql-interfaces
L J Bayuk <ljb220@mindspring.com> writes:
> I just haven't decided
> whether to flush before reading, or flush after all messages that need a
> response (I think: Startup, PasswordMessage, Query, Sync, CopyDone, and
> FunctionCall are the ones I use).

You seem to have quite missed my point.  If you decide to flush on the
basis of flush-after-certain-message-types-are-sent, then the types to
flush after are precisely Sync and Flush.  If you think you want
something different, you are wrong and should think again (or more
likely, insert Flush messages into the outgoing stream at the places
where you want a flush to occur).  There is no point in flushing after
any other message type because the backend won't flush its response.

Of course this is all moot if you choose to flush just before waiting
for input (though you'd still better be sure that Flush or Sync was the
last message sent before you do so).

> I could not find the described flush "when control returns to the main
> loop". Either I'm missing it, or it isn't there, and the comment implies
> that it may have been there at one time.

It's actually in ReadyForQuery() these days.
        regards, tom lane


pgsql-interfaces by date:

Previous
From: "Jim Buttafuoco"
Date:
Subject: Re: [Fwd: typlen field in the pg_type table]
Next
From: L J Bayuk
Date:
Subject: Re: pgin.tcl pg_exec_prepared slow (was: Released...)