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


From: "Thanks" <Thanks(at)verymuch(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: pg_fetch_array
Date: 2004-06-14 09:12:25
Message-ID: cajq71$2vku$ (view raw, whole thread or download thread mbox)
Lists: pgsql-performance

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.


pgsql-performance by date

Next:From: Dawn HollingsworthDate: 2004-06-14 15:24:07
Subject: Re: [BULK] Problems with vacuum!
Previous:From: Tom LaneDate: 2004-06-13 17:59:24
Subject: Re: Additional select fields in a GROUP BY

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