Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 42BBE476BCA for ; Wed, 19 Jun 2002 15:59:05 -0400 (EDT) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 640A5477261 for ; Wed, 19 Jun 2002 14:45:28 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id 2626D38192D; Wed, 19 Jun 2002 14:44:47 -0400 (EDT) From: "Work" X-Newsgroups: comp.databases.postgresql.interfaces.php, comp.databases.postgresql.questions Subject: Optimizing queries Date: Wed, 19 Jun 2002 14:44:33 -0400 Organization: DigiVision Lines: 15 Message-ID: Reply-To: "Work" X-Complaints-To: news@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-general@postgresql.org, pgsql-php@postgresql.org X-Archive-Number: 200206/920 X-Sequence-Number: 26069 Hi , I am a newbie to the world of Postgres, I am currently optimizing PHP/Postgres applications. My problem is that I have a query that throws certain rowsets and depending on these values I loop other tables to get the desired columns. I am using a heavy for-loop for this purpose, within the for-loop I have further sub-queries, so that for every loop iteration I execute these sub-queries, I dont see a way to reorganize this structure. Can somebody suggest a better way. Thanks Regards Sid