|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36399 query from many join table in postgresql very slow
Submitted: 2006-02-15 09:15 UTC Modified: 2006-02-15 10:11 UTC
From: maccran at hotmail dot com Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 5.1.2 OS: freebsd 5.4
Private report: No CVE-ID: None
 [2006-02-15 09:15 UTC] maccran at hotmail dot com
from the source code, the using time in this query about
7-10 ms (for exec pg_query) but when i using EXPLAIN ANALYZE in query, postgresql say it using 0.9 ms in query, so i think it very lost time in pg_query 5-8 ms. Because my web page have 4-10 query per page this consume time it make my server cannot service more than 20 page/sec (1/(5 query X 10 ms), if reduce this time it very speed up my php page

this problem not appear if query from one table , but when join table more than one table in query it happen.

in jsp&jdbc does not have any this problem

Reproduce code:
function microtime_float()
{    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);}

$q = "select,,,,
      from a,b,c,d,e
      where and 
            and and";

$time_start = microtime_float();
pg_query ($q);
$time_end = microtime_float();
$time = $time_end - $time_start;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-15 10:11 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Not PHP problem.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue May 11 11:01:23 2021 UTC