[SQL] Recursively traversing a partially ordered set

2007-05-29 Thread Jason Grout
I have a performance related question (and a few code snippets to contribute to the list archives). I am trying to write a function that recursively walks a hierarchal structure to find all ancestors or descendants of a particular item or list of items. My relationships are set up with the

Re: [SQL] Recursively traversing a partially ordered set

2007-05-29 Thread Gregory Stark
Jason Grout [EMAIL PROTECTED] writes: 2. Is there a big difference in speed between using an array versus using a SELECT in a WHERE condition? In other words, which is generally going to be faster: SELECT * from table where field IN (some function returning a SETOF); or SELECT * from