View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
10743Bug reportsSurvey editingpublic2016-03-16 09:18
Reporterollehar Assigned Toollehar  
PriorityhighSeverityminor 
Status closedResolutionfixed 
Product Version2.50.x 
Target Version2.50.xFixed in Version2.50.x 
Summary10743: Remove all count(findAll()) from Survey_Common_Action
Description

There's a bunch of

$arr = $db->findAll();
$sum = count($arr);

in Survey_Common_Action.php.

This is slow for big surveys. Should use this function:

$count = Table::Model()->count("field=:field", array("field" => $fildID));
echo $count;

Source: http://www.yiiframework.com/forum/index.php/topic/10662-count-on-a-findall-query/

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)latest
I will donate to the project if issue is resolvedNo
Browser-
Database type & version-
Server OS (if known)-
Webserver software & version (if known)-
PHP Version-

Users monitoring this issue

There are no users monitoring this issue.

Activities

LouisGac

LouisGac

2016-03-11 13:25

developer   ~36403

Last edited: 2016-03-11 14:33

It's much worst than that.
Count functions are use in so many different parts.

The only way do it really well, would be to move all those stuff from core/controller/helpers/views to the model.

But for now : debugging.

ollehar

ollehar

2016-03-11 13:50

administrator   ~36406

The solution doesn't have to be perfect. :) And it's easy enough to fix - just replace db->findAll() with db->count() (built-in Yii function).

ollehar

ollehar

2016-03-11 14:31

administrator   ~36409

This commit fixes some: 43bdc29ea03a80d55520b7130f1fda909e3226f3

c_schmitz

c_schmitz

2016-03-16 09:18

administrator   ~36545

Version 2.50+ Build 160316 released

Issue History

Date Modified Username Field Change
2016-03-11 12:17 ollehar New Issue
2016-03-11 13:07 c_schmitz Assigned To => ollehar
2016-03-11 13:07 c_schmitz Status new => assigned
2016-03-11 13:07 c_schmitz Priority none => high
2016-03-11 13:25 LouisGac Note Added: 36403
2016-03-11 13:50 ollehar Note Added: 36406
2016-03-11 14:31 ollehar Note Added: 36409
2016-03-11 14:33 LouisGac Note Edited: 36403
2016-03-11 14:37 ollehar Status assigned => resolved
2016-03-11 14:37 ollehar Fixed in Version => 2.5
2016-03-11 14:37 ollehar Resolution open => fixed
2016-03-16 09:18 c_schmitz Note Added: 36545
2016-03-16 09:18 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing