Oliver Leitner | 3 Apr 10:45
Picon
Gravatar

phplist uclicks.php slow cause of big table

Hello Developers

I am trying to increase Performance on the Database queries which are
called from uclicks

This is how far i got till now:

$limitquery = Sql_Fetch_Row_query(sprintf('select HIGH_PRIORITY
SQL_CACHE SQL_BIG_RESULT count(phplist_message.owner) from %s where
phplist_message.owner =
%d',$GLOBALS['tables']['message'],$_SESSION["logindetails"]["id"]));
...
...
if (!$id) {
  print $GLOBALS['I18N']->get('Select URL to view');
  $req = Sql_Query(sprintf('select HIGH_PRIORITY SQL_CACHE
SQL_BIG_RESULT distinct url, linkid, sum(clicked) as numclicks from %s
    where clicked %s group by url order by numclicks desc limit
'.$limitquery[0],
    $select_tables,$owner_and));
  $ls = new WebblerListing($GLOBALS['I18N']->get('Available URLs'));
  while ($row = Sql_Fetch_Array($req)) {
    $ls->addElement($row['url'],PageURL2('uclicks&id='.$row['linkid']));
    $ls->addColumn($row['url'],$GLOBALS['I18N']->get('clicks'),$row['numclicks']);
  }
  print $ls->display();
  return;
}
...
...
(Continue reading)

Michiel Dethmers | 3 Apr 13:29
Picon
Favicon

Re: phplist uclicks.php slow cause of big table


Are you doing this on 2.10 or 2.11?

If you have loads of users/messages or links, it's best to use 2.11.3.
It'll be more efficient about storing the data. Nevertheless, the
problem as you describe is still there, but it's where the changes
should take place.

Michiel

Oliver Leitner wrote:
> Hello Developers
>
> I am trying to increase Performance on the Database queries which are
> called from uclicks
>
> This is how far i got till now:
>
> $limitquery = Sql_Fetch_Row_query(sprintf('select HIGH_PRIORITY
> SQL_CACHE SQL_BIG_RESULT count(phplist_message.owner) from %s where
> phplist_message.owner =
> %d',$GLOBALS['tables']['message'],$_SESSION["logindetails"]["id"]));
> ...
> ...
> if (!$id) {
>   print $GLOBALS['I18N']->get('Select URL to view');
>   $req = Sql_Query(sprintf('select HIGH_PRIORITY SQL_CACHE
> SQL_BIG_RESULT distinct url, linkid, sum(clicked) as numclicks from %s
>     where clicked %s group by url order by numclicks desc limit
> '.$limitquery[0],
(Continue reading)


Gmane