Re: [SQL] Joins involving functions

2006-04-11 Thread Markus Schaber
Hi, Jeff Boes, Jeff Boes wrote: > select * from bar > cross join f_foo(bar.b) as foo; > > Unfortunately, this last statement returns an error: > > NOTICE: adding missing FROM-clause entry for table "bar" > ERROR: function expression in FROM may not refer to other relations of > same query lev

Re: [SQL] how to use recursion to find end nodes of a tree

2006-04-11 Thread mike
Thankyou very much Yasir and Ross for your help and advice. I have created a pl/pgsql version of Yasirs algorithm which works perfectly, I am also looking into improving efficiency by flaging leaf records. Here is my pl/pgsql solution in case it helps anyone out: CREATE OR REPLACE FUNCTION paren

Re: [SQL] slow 'IN' clause

2006-04-11 Thread Bruno Wolff III
On Sun, Apr 09, 2006 at 20:44:34 -0700, [EMAIL PROTECTED] wrote: > I have a slow sql: > SELECT * FROM mytable WHERE id IN (1,3,5,7,3k here...); > mytable is about 10k rows. > > if don't use the "IN" clause, it will cost 0,11 second, otherwise it > will cost 2.x second > I guess pg use linear