Re: Terminating a SETOF function call sequence

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Terminating a SETOF function call sequence
Date: 2005-02-17 15:28:53
Message-ID: 7126.1108654133@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Hallgren <thhal(at)mailblocks(dot)com> writes:
> My question is, what happens when the evaluator doesn't need more rows?
> Will it:
> a) call the function with call_cntr >= max_calls?
> b) continue calling until the set is exhausted anyway?
> c) simply stop calling?

(c)

> a) seems unlikely since max_calls is set by the user, b) doesn't seem
> very optimal, and c) would be very bad since it doesn't give me any
> chance to release the resources that where used in order to produce the
> rows.

This is what RegisterExprContextCallback is for.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Hallgren 2005-02-17 15:39:16 Re: Terminating a SETOF function call sequence
Previous Message Andrew Dunstan 2005-02-17 15:21:48 Re: win32 performance - fsync question