Re: pgin.tcl pg_exec_prepared slow (was: Released...)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: L J Bayuk <ljb220(at)mindspring(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: pgin.tcl pg_exec_prepared slow (was: Released...)
Date: 2004-07-10 00:07:56
Message-ID: 739.1089418076@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

L J Bayuk <ljb220(at)mindspring(dot)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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message L J Bayuk 2004-07-12 01:33:04 Re: pgin.tcl pg_exec_prepared slow (was: Released...)
Previous Message Jim Buttafuoco 2004-07-08 18:58:54 Re: [Fwd: typlen field in the pg_type table]