Re: [SQL] Table returning functions

2010-09-20 Thread Jann Röder
True, but it still allowed me to write queries that I do not know how to express otherwise. Am 20.09.10 01:58, schrieb Tom Lane: > =?UTF-8?B?SmFubiBSw7ZkZXI=?= writes: >> Ok I now know that it really seems to do what I expected. But I still >> wonder what it does if I use two functions f() and g(

Re: [SQL] Table returning functions

2010-09-19 Thread Jann Röder
like this: id | a1 | b1 id | a2 | b2 id | a3 | I haven't tried this, so it could be something completely different. In any case I think this should be documented. Jann Am 08.09.10 15:35, schrieb Jann Röder: > Hi, > I have a question which does not seem to be covered in the > docu

[SQL] Table returning functions

2010-09-08 Thread Jann Röder
Hi, I have a question which does not seem to be covered in the documentation: I have a function f(i) that returns a table with three columns (a, b, c). In the documentation (http://www.postgresql.org/docs/8.4/interactive/xfunc-sql.html#XFUNC-SQL-FUNCTIONS-RETURNING-SET) it says that (even though d

Re: [SQL] Inefficient query plan

2010-08-23 Thread Jann Röder
Please ignore this post. I accidentally double posted here and on the performance mailing list. I think this belongs on the performance list. Sorry for the noise. Jann Am 23.08.10 06:05, schrieb Jann Röder: > I have two tables: > A: ItemID (PK), IsssueID (Indexed) > B: ItemID (FK), In

[SQL] Inefficient query plan

2010-08-22 Thread Jann Röder
I have two tables: A: ItemID (PK), IsssueID (Indexed) B: ItemID (FK), IndexNumber : PK(ItemID, IndexNumber) Both tables have several million columns, but B has much more than A. Now if I run SELECT A.ItemID FROM A, B WHERE A.ItemID = B.itemID AND A.issueID = The query takes extremely long (sev