Re: ReadyForQuery() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ReadyForQuery()
Date
Msg-id 22336.1167934654@sss.pgh.pa.us
Whole thread Raw
In response to ReadyForQuery()  ("Simon Riggs" <simon@2ndquadrant.com>)
Responses Re: ReadyForQuery()  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.com> writes:
> Wouldn't it be better to issue ReadyForQuery() and then issue the stat
> stuff in the gap between processing? 

To me, "ready for query" means "ready for query", not "I think I might
be ready soon".  Otherwise you could argue for trying to move the
message emission much further upstream than that.  Another problem is
that on a lot of kernels, control swaps to the client process the
instant we issue the send(), and if the client is well-coded control
will swap back when it send()s us the next query.  If we rearrange
things as you suggest then the state display will become quite
misleading: it will claim we are still busy when actually the client
has the result, and it will switch to "idle" *after* we've received
a new command.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] Small vcbuild patch
Next
From: markwkm@gmail.com
Date:
Subject: Re: 8.3 pending patch queue