DB PostgreSQL driver probrem

From: Date: Fri, 23 Aug 2002 09:39:10 +0000
Subject: DB PostgreSQL driver probrem
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-8614@lists.php.net to get a copy of this message
Hi. I found a problem of tableInfo method in DB/DB/pgsql.php. The Current implementation is using query "SELECT * FROM $result". When $result is a big table, a process will consume a lot of memories. (And it also takes time very much.) Is adding "LIMIT 1" to that correct? Regards, -- KUBO Atsuhiro Index: DB/DB/pgsql.php =================================================================== RCS file: /repository/pear/DB/DB/pgsql.php,v retrieving revision 1.9 diff -u -r1.9 pgsql.php --- DB/DB/pgsql.php 23 Aug 2002 08:30:24 -0000 1.9 +++ DB/DB/pgsql.php 23 Aug 2002 09:29:57 -0000 @@ -702,7 +702,7 @@ // table without a resultset if (is_string($result)) { - $id = @pg_exec($this->connection,"SELECT * FROM $result"); + $id = @pg_exec($this->connection,"SELECT * FROM $result LIMIT 1"); if (empty($id)) { return $this->pgsqlRaiseError(); }

« previous php.pear.dev (#8614) next »