Re: timeout implementation issues - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: timeout implementation issues
Date
Msg-id 200204080322.g383M3Z11609@candle.pha.pa.us
Whole thread Raw
In response to Re: timeout implementation issues  (Hiroshi Inoue <Inoue@tpf.co.jp>)
Responses Re: timeout implementation issues  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
List pgsql-hackers
Hiroshi Inoue wrote:
> Bruce Momjian wrote:
> > 
> > > > > Sorry I couldn't understand your point.
> > > > > It seems the simplest and the most certain way is to call
> > > > > 'SET QUERY_TIMEOUT per query. The way dosen't require
> > > > > RESET at all.  Is the overhead an issue ?
> > > >
> > > > What about psql and libpq.  Doing a timeout before every query is a
> > > > pain.
> > >
> > > Psql and libpq would simply issue the query according to the
> > > user's request as they currently do. What's pain with it ?
> > 
> > If they wanted to place a timeout on all queries in a session, they
> > would need a SET for every query, which seems like a pain.
> 
> Oh I see. You mean users' pain ?

Sorry I was unclear.

> If a user wants to place a timeout on all the query, he
> would issue SET query_timeout command only once.

I am confused.  Above you state you want SET QUERY_TIMEOUT to be
per-query.  I assume you mean that the timeout applies for only the next
query and is turned off after that.  If you do that, it is hard to set a
maximum duration for all queries in your session, especially in psql or
libpq.

Also, I am not saying that the timeout is for the entire session, but
that the timeout makes sure that any query in the session that takes
longer than X milliseconds is automatically cancelled.

Please reply and let me know what you think.  I am sure I am missing
something in your comments.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: timeout implementation issues
Next
From: Bruce Momjian
Date:
Subject: Re: Suggestion for optimization