View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
04389 | Bug reports | Other | public | 2010-06-02 19:26 | 2010-06-08 21:51 |
Reporter | jdalegonzalez | Assigned To | mdekker | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.87 | ||||
Fixed in Version | 1.90RC1 | ||||
Summary | 04389: abmultiscalequery is executed more times than is necessary | ||||
Description | Around line 2337 in index.php, a query is done to grab the labels associated with a "Array, flexible labels, dual scale" question. The query is inside a while loop iterating over the results of the query that pulls in the question and answer table values for the question being fetched. Since the internal query ($abmultiscalequery = ...) doesn't use any of variables populated by the while loop, the query for labels can be moved outside the while loop and be run only once per question. Further, the exact same query is executed twice inside the loop with no change to the query parameters. One can be removed, right? Once it's used to set the value of $fieldname.$abrow['code']."#0" and the second time it's used to set $fieldname.$abrow['code']."#1". Finally, in both instances, while all of the values of the label field are fetched, the only thing used is a count of the rows returned. The query could be turned into a "select count() as cnt"; $abmultiscalecount = $result['cnt'] instead of a "select l."; $abmultiscalecount = $result.RecordCount();\ | ||||
Steps To Reproduce | Look at the code in index.php around line 2336 and verify my analysis | ||||
Tags | No tags attached. | ||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 8488 | ||||
I will donate to the project if issue is resolved | |||||
Browser | N/A | ||||
Database type & version | Postgres but really N/A | ||||
Server OS (if known) | Linux but really N/A | ||||
Webserver software & version (if known) | Apache but really N/A | ||||
PHP Version | 5.X but really N/A | ||||
Carsten, do you think we can close this one because label set handling was completely reworked at version 1.90? |
|
Confirming this is still an issue, even worse, we don't even use the record count anymore. Taking this bug to fix. |
|
Fixed in rev 8789 |
|
Wow. That was fast. Thanks guys. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2010-06-02 19:26 | jdalegonzalez | New Issue | |
2010-06-02 19:26 | jdalegonzalez | Status | new => assigned |
2010-06-02 19:26 | jdalegonzalez | Assigned To | => user372 |
2010-06-04 01:38 | Mazi | Note Added: 12133 | |
2010-06-04 01:38 | Mazi | Assigned To | user372 => c_schmitz |
2010-06-04 11:06 | mdekker | Assigned To | c_schmitz => mdekker |
2010-06-04 11:11 | mdekker | Note Added: 12147 | |
2010-06-04 11:14 | mdekker | Note Added: 12148 | |
2010-06-04 11:14 | mdekker | Status | assigned => resolved |
2010-06-04 11:14 | mdekker | Resolution | open => fixed |
2010-06-04 11:31 | mdekker | Fixed in Version | => 1.90RC1 |
2010-06-04 21:41 | jdalegonzalez | Note Added: 12174 | |
2010-06-08 21:51 | c_schmitz | Status | resolved => closed |
2010-10-25 00:21 | c_schmitz | Category | Data Access => (No Category) |