Hi,
I have 3 million row entries in my grid. To get the count of this number this query is generated
" SELECT count(*) as c FROM (SELECT * from table_name where column = 27 ) table_count "
This is taking all my server cores and is delaying my site load time.
Is there a way to optimize this????
If not how can I remove this call from the grid.
Hello,
One option is to have index on this column.
Alternate option is to set:
$g->select_count = "…"; // your count record query except where clause.
$g->select_count = "select count(*) from table";
Hi,
My Table is indexed.
$g->select_count = "select count(*) from table";
gives me count as 50 and I cant access anything after 50.
Is there a way to remove this?
Hello,
I can't understand the issue. If count is correct, how can you access after 50.
Please explain little further what exactly is the issue.
Hi,
here is the link for a photo without select_count line in my code
Here is the link for a pgpto with select_count line in my code
I put the followiung code in the grid
$g->select_count = "SELECT count(*) from $table_name where client = " . $clients;
I have put this below my select_command
$g->select_command = "SELECT * from $table_name where client = " . $clients;