Cutting Grid Load Time in Half

QuestionsCutting Grid Load Time in Half
CJ asked 7 years ago

I have some resource intensive queries that run and populate in the grid (30+ seconds). When the user click on the link to load these pages, it takes nearly 30 seconds for the grid to even show up, and another 30 seconds of it saying "Loading" before it displays data.

I eventually discovered that the source code issues the same query I have, with a "LIMIT 1" on the end; and it looks like this is done to get the column names and data types. If this is the case, why not use "LIMIT 0" so it will return instantly?

I change my jqgrid_dist.php to this and the grid loads and displays in 1/2 the time (30 seconds!). Is this not viable for other DB's or something? Why not do this all the time?

1 Answers
Abu Ghufran answered 7 years ago

Hi,

I agree with your idea, you can search / replace jqgrid_dist.php

if(!$cols || $change_field)
{
$sql = $this->select_command . " LIMIT 0 OFFSET 0";
$sql = $this->prepare_sql($sql,$this->db_driver);

}

I have tested and this works with mysql. We will need more database checking to incorporate in release build.

Your Answer

0 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?