php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: maccran at hotmail dot com
New email:
PHP Version: OS:

 

 [2006-02-15 09:15 UTC] maccran at hotmail dot com
Description:
------------
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 a.id, b.id, c.id, d.id, e.id
      from a,b,c,d,e
      where a.id=b.aid and b.id=c.bid 
            and c.id=d.cid and d.id=e.did";

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




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-15 10:11 UTC] tony2001@php.net
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 http://www.php.net/support.php 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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 17:01:30 2024 UTC