Actually it taking 1 min 30 secs to load the page.
There are 6 tables and 2 charts on the page.
mysql and oracle DB connections.
The phpgrid layout is in a separate file and is an include in the main page.
The 2 charts load very quickly and their data is from mysql
The first table loads fairly quickly.
all the rest of the tables seem to load in sequence, each taking 20 seconds or more to load.
the next table will not load until the previous one is done.
These are very small queries the largest containing 87 records.
The queries run very fast when pulled directly from mysql or Oracle 0.007 seconds to complete.
But when pulled from phpgrid it can take over 25 seconds to pull.
Can anyone point me in the right direction?
If your table uses mysql indexes, one known issue is grid uses subquery to fetch count of rows.
e.g. SELECT count(*) from ( SELECT …… )
Now the actual query goes in subquery, which in mysql restricts use of mysql indexes.
Solution could be to use custom e.g.
// you can provide custom SQL query to display data
$g->select_command = "SELECT i.id, invdate , c.name,
i.note, i.total, i.closed FROM invheader i
INNER JOIN clients c ON c.client_id = i.client_id";
// you can provide custom SQL count query to display data, remember to alias as 'c'
$g->select_count = "SELECT count(*) as c FROM invheader i
INNER JOIN clients c ON c.client_id = i.client_id";
The data is loaded with ajax calls and uses session information. The delayed loading of grids (one after another) could be due to session file locking, causing wait time for second http ajax request.
In case issue is not resolved, you can email (db sql + grid code) to our support team at [email protected] for further analysis.