X-Original-To: pgsql-php@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 94BAB924D79 for ; Fri, 23 May 2003 08:04:30 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 35413-10 for ; Fri, 23 May 2003 08:03:57 -0400 (EDT) Received: from gw1.nio.org (fw1.nio.org [210.212.160.229]) by developer.postgresql.org (Postfix) with ESMTP id 2AE3B923489 for ; Fri, 23 May 2003 06:23:06 -0400 (EDT) Received: from csnio.ren.nic.in (IDENT:root@localhost.localdomain [127.0.0.1]) by gw1.nio.org (8.11.2/8.8.7) with ESMTP id h4NAA8b13976 for ; Fri, 23 May 2003 15:40:08 +0530 Received: from 172.27.1.111 (172.27.1.111) by ASSP-nospam ; 23 May 03 10:10:07 -0000 Received: from darya.nio.org ([192.168.1.111]) by csnio.ren.nic.in (8.9.3/8.8.7) with SMTP id QAA02060 for <@csnio.ren.nic.in:pgsql-php@postgresql.org>; Fri, 23 May 2003 16:16:55 +0530 Received: from darya.nio.org (himalaya.nio.org [172.27.9.1]) by darya.nio.org (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA02389 for ; Fri, 23 May 2003 16:56:04 -0700 Message-ID: <3ECE40AB.73544B27@darya.nio.org> Date: Fri, 23 May 2003 15:39:23 +0000 From: Mukta Telang X-Mailer: Mozilla 4.51 [en] (X11; I; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-php@postgresql.org Subject: faster output from php and postgres Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Assp-Spam-Prob: 0.00000 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/29 X-Sequence-Number: 2034 Hi, I am dealing with a database with many-to-many relation and have a php script that joins these tables and displays the output. But the problem is that after entering some 50 records the output is very slow! I can count till 50 before the script produces the output! The complete description of the problem is written below.. Thanks in advance, Mukta description in detail: database part: Three tables: paper,author and author_paper "A paper has many authors and an author has many papers." In this way there is many to many relation. The attributes of paper are: paper_id (primary key),title,journal,year etc The attributes of author are: author_id(primary key) and name The attributes of author_paper are: author_id ,paper_id and level ( author with level=1 is the main author of the paper ) php part: For an author: 1. get author_id from author table 2. select all paper_ids from author_paper table 3. For each of the above selected paper_ids: a. print all the attributes of paper b. select all authors of the paper and print their names in the order of their "level"