X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5F266D1B172 for ; Mon, 14 Jun 2004 06:25:27 -0300 (ADT) 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 68654-08 for ; Mon, 14 Jun 2004 09:25:00 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 13FB3D1B16F for ; Mon, 14 Jun 2004 06:20:54 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i5E9JXDW098707 for ; Mon, 14 Jun 2004 09:19:33 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i5E9D5rT097953 for pgsql-performance@postgresql.org; Mon, 14 Jun 2004 09:13:05 GMT From: "Thanks" X-Newsgroups: comp.databases.postgresql.performance Subject: pg_fetch_array Date: Mon, 14 Jun 2004 17:12:25 +0800 Organization: Hub.Org Networking Services Lines: 29 Message-ID: X-Complaints-To: usenet@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-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.9 tagged_above=0.0 required=5.0 tests=NO_DNS_FOR_FROM, PRIORITY_NO_NAME X-Spam-Level: * X-Archive-Number: 200406/208 X-Sequence-Number: 7266 Hello.... I would like to know the performance of pg_fetch_array. Cosider the code: $query = "select * from foo"; $result = pg_query( $db, $query ); while ($row = pg_fetch_array($result)) { $a = $row["a"]; $b = $row["b"]; $c = $row["c"]; $d = $row["d"]; } Does php need to read database everytime when pg_fetch_array is executed in the while loop or all the rows have been in the memory after pg_query? If read database is needed, is there any method to copy all the rows into memory by using other command? (because I have a application which needs large amount database update/retrieval and I wish the performance of the overall applications run faster.) or other method you would like to recommend in order to make the faster response time? Thank you in advance.