X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F33CE55F4A for ; Mon, 14 Mar 2005 11:26:25 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77834-02 for ; Mon, 14 Mar 2005 11:26:17 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id 800B755EAE for ; Mon, 14 Mar 2005 11:26:14 +0000 (GMT) Received: (qmail-ldap/ctrl 33565 invoked from network); 14 Mar 2005 11:26:14 -0000 Received: from unknown (HELO jupiter.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 14 Mar 2005 11:26:14 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by jupiter.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j2EBQK927956 for ; Mon, 14 Mar 2005 12:26:20 +0100 (MET) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id ; Mon, 14 Mar 2005 12:26:20 +0100 Message-ID: From: =?ISO-8859-1?Q?K=D6PFERL_Robert?= To: pgsql-sql@postgresql.org Subject: How does the planner treat a table function. Date: Mon, 14 Mar 2005 12:26:16 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200503/196 X-Sequence-Number: 20675 Hi, we have got some tables (uw?) and functions. One function is defined like get_abc(): SELECT a,b,c from table_x; What happens if I query something like SELECT a,b from get_abc() where a=5; while table_x is rather big? Will PSQL at first query all records of table_x and then apply a where a=5 OR will PSQL integrate it to a shorter query? (In case there will be of course an intex over a to prevent sequential search)