Re: keep alive and running query - Mailing list pgsql-admin

From Albe Laurenz
Subject Re: keep alive and running query
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17C8402A@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Re: keep alive and running query  (desmodemone <desmodemone@gmail.com>)
List pgsql-admin
desmodemone wrote:
> By the way, the problem, as I show , it's for DWH or similar environment where it's usually to have a
> long running query (with sort / group by / hash , so before the first rows
> is returned, it needs time) and in those cases , if the client will die, the backend will run for a
> lot of time before the backend will try to write to the socket.
> 
> So it's possible to have a heavy load in a database server with a lot of death connections where the
> backends are still working as described.
> 
> I think it's not a minor problem, no?

No, it isn't.

But if that happens on a routine basis, I would argue that the client
program is at fault.  It should cancel the query and close the session
when the user interrupts or closes it.
Admitted, it cannot do that if the client machine crashes, the network
connection dies or the user kills the program with SIGKILL, but I'd say
that this should not happen on a regular basis.

I don't know how easy it would be to add code for the server to check
the state of the network sockets regularly.

Yours,
Laurenz Albe

pgsql-admin by date:

Previous
From: desmodemone
Date:
Subject: Re: keep alive and running query
Next
From: "Campbell, Lance"
Date:
Subject: pg dump only indexes