Skip site navigation (1) Skip section navigation (2)

pg_fetch_array

From: "Thanks" <Thanks(at)verymuch(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: pg_fetch_array
Date: 2004-06-14 05:02:06
Message-ID: cajbi8$1qrd$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-php
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 things 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.





Responses

pgsql-php by date

Next:From: ljbDate: 2004-06-15 00:04:57
Subject: Re: pg_fetch_array
Previous:From: Scott MarloweDate: 2004-06-13 16:39:05
Subject: Re: PGSQL Manager

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group