From: Thanks <Thanks@verymuch.com>
To: pgsql-performance@postgresql.org
Subject: pg_fetch_array
Date: Mon, 14 Jun 2004 17:12:25 +0800
Message-ID: <cajq71$2vku$1@news.hub.org> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: Thanks@verymuch.com
Subject: Re: pg_fetch_array
In-Reply-To: <cajq71$2vku$1@news.hub.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox