X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2139AD1B285 for ; Mon, 21 Jun 2004 18:09:29 -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 38335-02 for ; Mon, 21 Jun 2004 21:09:23 +0000 (GMT) Received: from web53702.mail.yahoo.com (web53702.mail.yahoo.com [206.190.37.23]) by svr1.postgresql.org (Postfix) with SMTP id C23DED1B220 for ; Mon, 21 Jun 2004 18:09:19 -0300 (ADT) Message-ID: <20040621210921.47715.qmail@web53702.mail.yahoo.com> Received: from [199.217.234.6] by web53702.mail.yahoo.com via HTTP; Mon, 21 Jun 2004 14:09:21 PDT Date: Mon, 21 Jun 2004 14:09:21 -0700 (PDT) From: George Essig Subject: Re: pg_fetch_array To: Thanks@verymuch.com Cc: pgsql-php@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/50 X-Sequence-Number: 2824 Thanks@verymuch.com wrote: > 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? The latter - pg_query puts all of the rows in memory. I found this out myself recently. Select a lot of rows using pg_query without pg_fetch_array. As you're doing this, watch he memory usage with 'free -s 1'. George Essig