#21332 [Fbk->Opn]: tableInfo performes hilierious call to the postgresql database
| From: | jkkn at tv2 dot dk | Date: | Fri, 10 Jan 2003 10:44:25 +0000 |
| Subject: | #21332 [Fbk->Opn]: tableInfo performes hilierious call to the postgresql database | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-12226@lists.php.net to get a copy of this message | ||
ID: 21332
User updated by: jkkn@tv2.dk
Reported By: jkkn@tv2.dk
-Status: Feedback
+Status: Open
Bug Type: PEAR related
Operating System: Linux
PHP Version: 4.3.0
New Comment:
The problem is that if you actually have data in your tables, the query
as it is in the DB class at the moment will transfer the entire table
up to PHP - this takes a lot of time on large tables and is meaningless
when what we actually only want is table information.
Adding LIMIT 0 will avoid this and speedup the tableinfo call with
minutes on large tables and will do the trick for what we need. This
makes tableinfo a usefull feature - right now it is meaningless since
you will have to reoptimize it when you actually have data in the
table.
Previous Comments:
------------------------------------------------------------------------
[2003-01-08 17:19:50] kalowsky@php.net
what exactly is the problem?
------------------------------------------------------------------------
[2003-01-02 03:46:03] jkkn@tv2.dk
Patch below fixes the problem:
--- pgsql.php Thu Jan 2 10:32:58 2003
+++ pgsql.php.fixed Thu Jan 2 10:32:47 2003
@@ -700,7 +700,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 0");
if (empty($id)) {
return $this->pgsqlRaiseError();
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21332&edit=1