Re: Intervening in Parser -> Planner Stage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Arguile" <arguile(at)lucentstudios(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Intervening in Parser -> Planner Stage
Date: 2002-03-05 18:47:07
Message-ID: 17423.1015354027@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Arguile" <arguile(at)lucentstudios(dot)com> writes:
> I'm currently pursuing a line of thought on resource limiting, and I'd like
> some opinions on whether it's possible/probable.

These seem like fairly indirect ways of limiting resource usage. Why
not instead set a direct limit on the amount of runtime allowed?

Postgres doesn't use the ITIMER_VIRTUAL (CPU time) timer, so about all
you'd need is
setitimer(ITIMER_VIRTUAL, &itimer, NULL);
to a suitable limit before starting query execution, and cancel it again
at successful query end. Set the SIGVTALRM signal handler to
QueryCancelHandler (same as SIGINT), and voila. A direct solution in
about ten lines of code ...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2002-03-05 18:54:31 Re: Mandrake RPMs uploaded
Previous Message Bruce Momjian 2002-03-05 18:37:24 Re: Postgresql backend to perform vacuum automatically