View Issue Details

This bug affects 2 person(s).
 14
IDProjectCategoryView StatusLast Update
18473Bug reportsSurvey editingpublic2024-04-16 13:55
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version6.4.x 
Summary18473: Survey listing : multiple call of template
Description

When goes to survey listing with SQLdebug set : we see multiple call of same rquest

Steps To Reproduce

Steps to reproduce

Activate debug + SQL debug
Goes to survey litsing
Check SQL log

Expected result

Have some SQL with 3 or 15 call

Actual result

Lot of SQL request with bunch of call

TagsNo tags attached.
Attached Files
Bug heat14
Complete LimeSurvey version number (& build)6.X
I will donate to the project if issue is resolvedNo
Browserfirefox
Database type & versionmariadb
Server OS (if known)debian
Webserver software & version (if known)nginx
PHP Version7.4

Relationships

related to 19371 resolvedlajosarpad Bug reports Survey list page extremely slow when having alot of surveys and inheritance is used for 'List publicly' 
related to 19504 ready for code reviewgabrieljenik Bug reports Potential PHP Warning when get Survey listing 

Users monitoring this issue

JanE

Activities

DenisChenu

DenisChenu

2022-11-09 09:51

developer   ~72650

Here : speed is OK because server are local
But with external SQL server : take long time

DenisChenu

DenisChenu

2022-11-09 12:35

developer   ~72671

I have 4 server on the same network, on public and one internal. 2 for production + 2 for prepoduction , proxy for high availability, SQL server on same network but another server.

The 5.X is the preprod for testing version : the link to the DB server are same all other configuration are same. And BD is just some week old.

For 5.X : i'm connected directly by internal VPN : less network
For 3.X : external + my own VPN (AirVPN) +

Survey listing on 5.X : 20.48 s
Same survey listing on 3.X 2.56s

… it's REALLY unusuable

DenisChenu

DenisChenu

2022-11-16 11:17

developer   ~72757

Idea one : Use a static array for template (like we do for Survey)

DenisChenu

DenisChenu

2022-12-14 17:42

developer   ~73122

Idea : better action : move some needed action to findByPk only (when we get THE survey)
See related

gabrieljenik

gabrieljenik

2023-08-31 18:52

manager   ~76827

better action : move some needed action to findByPk only (when we get THE survey)

Can we maybe do a lazy load of the template by overriding the getter?

DenisChenu

DenisChenu

2023-09-05 15:12

developer   ~76883

Can we maybe do a lazy load of the template by overriding the getter?

We only need checking valid template and get all options only in findByPk not in findAll (search)

I muts check with Dev: #18556: Possible optimisation when lot of survey #2791

This part : https://github.com/LimeSurvey/LimeSurvey/pull/2791/files#diff-0268c3e4648700cef058f99725fd5364a285bd35701d30cfda885a81ce1c86a4R172-R175

gabrieljenik

gabrieljenik

2023-09-05 16:30

manager   ~76887

We only need checking valid template and get all options only in findByPk not in findAll (search)

The code being executed is $model->template = xxxx in findByPk.
By having a special getter we can delay that an have that XXX being loaded only when $model->template is being called.

Just commenting that.

DenisChenu

DenisChenu

2023-09-05 18:16

developer   ~76888

Looking at SQL debug : seems we call https://github.com/LimeSurvey/LimeSurvey/blob/5e5dc6d6e6dbe4fdec88664bc2f748a918503519/application/models/Survey.php#L824 each time in Surey listing too …
Really uneeded.

DenisChenu

DenisChenu

2023-09-05 18:17

developer   ~76889

200 times group settings … 400 times user 1 …

DenisChenu

DenisChenu

2023-10-19 17:52

developer   ~77791

Still have 20 times : (2 x number of survey shown, with 5 : 10 times)

system.db.CDbCommand.query(SELECT *) WHERE (`t`.`gsid`=1))

41 times (have 42 surveys )

system.db.CDbCommand.query(SELECT * FROM `lime_users` `t` WHERE `t`.`uid`=1 LIMIT 1)

13 times for a lot of template

system.db.CDbCommand.query(SELECT `template`.`id` AS `t1_c0`, `template`.`name` AS `t1_c1`, `template`.`folder` AS `t1_c2`, `template`.`title` AS `t1_c3`, `template`.`creation_date` AS `t1_c4`, `template`.`author` AS `t1_c5`, `template`.`author_email` AS `t1_c6`, `template`.`author_url` AS `t1_c7`, `template`.`copyright` AS `t1_c8`, `template`.`license` AS `t1_c9`, `template`.`version` AS `t1_c10`, `template`.`api_version` AS `t1_c11`, `template`.`view_folder` AS `t1_c12`, `template`.`files_folder` AS `t1_c13`, `template`.`description` AS `t1_c14`, `template`.`last_update` AS `t1_c15`, `template`.`owner_id` AS `t1_c16`, `template`.`extends` AS `t1_c17` FROM `lime_templates` `template` WHERE (`template`.`name`=:ypl0). Bound with :ypl0='skelvanilla')
DenisChenu

DenisChenu

2024-02-14 18:03

developer   ~79500

GroupSettings : https://github.com/LimeSurvey/LimeSurvey/pull/3737
template : https://github.com/LimeSurvey/LimeSurvey/pull/3738

stull User :)

DenisChenu

DenisChenu

2024-02-15 16:45

developer   ~79526

https://github.com/LimeSurvey/LimeSurvey/pull/3738

DenisChenu

DenisChenu

2024-02-15 16:48

developer   ~79529

master https://github.com/LimeSurvey/LimeSurvey/pull/3738

DenisChenu

DenisChenu

2024-02-22 17:35

developer   ~79583

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=36117

DenisChenu

DenisChenu

2024-02-22 17:35

developer   ~79584

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=36116

DenisChenu

DenisChenu

2024-02-26 09:36

developer   ~79625

For 5X

LimeBot

LimeBot

2024-02-26 13:49

administrator   ~79638

Fixed in Release 6.4.9+240226

DenisChenu

DenisChenu

2024-03-05 17:21

developer   ~79726

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=36164

DenisChenu

DenisChenu

2024-03-05 17:21

developer   ~79727

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=36163

DenisChenu

DenisChenu

2024-03-07 12:05

developer   ~79754

For 5.X

DenisChenu

DenisChenu

2024-03-07 12:19

developer   ~79755

5.x : https://github.com/LimeSurvey/LimeSurvey/pull/3786

LimeBot

LimeBot

2024-03-11 15:17

administrator   ~79772

Fixed in Release 6.4.12+240311

DenisChenu

DenisChenu

2024-04-16 13:55

developer   ~79932

Fix committed to 5.x branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=36274

DenisChenu

DenisChenu

2024-04-16 13:55

developer   ~79933

Fix committed to 5.x branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=36273

Related Changesets

LimeSurvey: master 7406e0af

2024-02-22 17:35:51

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18473: Survey listing : multiple call of SurveyGroup (#3737) Affected Issues
18473
mod - application/models/SurveysGroupsettings.php Diff File

LimeSurvey: master 7406e0af

2024-02-22 17:35:51

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18473: Survey listing : multiple call of SurveyGroup (#3737) Affected Issues
18473
mod - application/models/SurveysGroupsettings.php Diff File

LimeSurvey: master bbc3eb6f

2024-03-05 17:21:32

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18473: Survey listing - multiple calls of template (#3738) Affected Issues
18473
mod - application/models/Template.php Diff File

LimeSurvey: master bbc3eb6f

2024-03-05 17:21:32

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18473: Survey listing - multiple calls of template (#3738) Affected Issues
18473
mod - application/models/Template.php Diff File

LimeSurvey: 5.x 16c8acb2

2024-04-16 13:48:55

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18473: Survey listing - multiple call of SurveyGroup (03787) Affected Issues
18473
mod - application/models/SurveysGroupsettings.php Diff File

LimeSurvey: 5.x 16c8acb2

2024-04-16 13:48:55

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18473: Survey listing - multiple call of SurveyGroup (03787) Affected Issues
18473
mod - application/models/SurveysGroupsettings.php Diff File

LimeSurvey: 5.x c6bed762

2024-04-16 13:49:39

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18473: Survey listing - multiple call of template (03786) Affected Issues
18473
mod - application/models/Template.php Diff File

LimeSurvey: 5.x c6bed762

2024-04-16 13:49:39

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18473: Survey listing - multiple call of template (03786) Affected Issues
18473
mod - application/models/Template.php Diff File

Issue History

Date Modified Username Field Change
2022-11-09 09:50 DenisChenu New Issue
2022-11-09 09:50 DenisChenu File Added: 5X_SurveyListing_noplugins.png
2022-11-09 09:50 DenisChenu File Added: 3X_SurveyListing_LOTPLUGINS.png
2022-11-09 09:51 DenisChenu Note Added: 72650
2022-11-09 09:51 DenisChenu Bug heat 0 => 2
2022-11-09 10:00 DenisChenu Summary Surey listing : multiple call of template and group => Survey listing : multiple call of template and group
2022-11-09 12:35 DenisChenu Note Added: 72671
2022-11-16 11:17 DenisChenu Note Added: 72757
2022-12-14 17:42 DenisChenu Note Added: 73122
2023-08-31 18:52 gabrieljenik Note Added: 76827
2023-08-31 18:52 gabrieljenik Bug heat 2 => 4
2023-08-31 18:54 gabrieljenik Assigned To => DenisChenu
2023-08-31 18:54 gabrieljenik Status new => acknowledged
2023-09-05 15:12 DenisChenu Note Added: 76883
2023-09-05 16:30 gabrieljenik Note Added: 76887
2023-09-05 18:16 DenisChenu Note Added: 76888
2023-09-05 18:17 DenisChenu Note Added: 76889
2023-10-19 17:52 DenisChenu Note Added: 77791
2023-10-19 17:56 DenisChenu Status acknowledged => assigned
2024-01-31 07:59 DenisChenu Relationship added related to 19371
2024-02-14 18:03 DenisChenu Note Added: 79500
2024-02-15 16:44 DenisChenu Summary Survey listing : multiple call of template and group => Survey listing : multiple call of template
2024-02-15 16:45 DenisChenu Note Added: 79526
2024-02-15 16:45 DenisChenu Assigned To DenisChenu => c_schmitz
2024-02-15 16:48 DenisChenu Status assigned => ready for code review
2024-02-15 16:48 DenisChenu Note Added: 79529
2024-02-22 17:35 DenisChenu Changeset attached => LimeSurvey master 7406e0af
2024-02-22 17:35 DenisChenu Changeset attached => LimeSurvey master 7406e0af
2024-02-22 17:35 DenisChenu Note Added: 79583
2024-02-22 17:35 DenisChenu Note Added: 79584
2024-02-22 17:35 DenisChenu Assigned To c_schmitz => DenisChenu
2024-02-22 17:35 DenisChenu Assigned To c_schmitz => DenisChenu
2024-02-22 17:35 DenisChenu Resolution open => fixed
2024-02-22 17:35 DenisChenu Resolution open => fixed
2024-02-24 11:04 DenisChenu Assigned To DenisChenu => tibor.pacalat
2024-02-24 11:04 DenisChenu Status ready for code review => ready for testing
2024-02-24 11:05 DenisChenu Product Version 5.4.x => 6.4.x
2024-02-24 11:05 DenisChenu Complete LimeSurvey version number (& build) 5.4.10 => 6.X
2024-02-26 09:36 DenisChenu Assigned To tibor.pacalat => DenisChenu
2024-02-26 09:36 DenisChenu Status ready for testing => assigned
2024-02-26 09:36 DenisChenu Note Added: 79625
2024-02-26 13:49 LimeBot Note Added: 79638
2024-02-26 13:49 LimeBot Status assigned => closed
2024-02-26 13:49 LimeBot Bug heat 4 => 6
2024-03-05 17:21 DenisChenu Changeset attached => LimeSurvey master bbc3eb6f
2024-03-05 17:21 DenisChenu Changeset attached => LimeSurvey master bbc3eb6f
2024-03-05 17:21 DenisChenu Note Added: 79726
2024-03-05 17:21 DenisChenu Note Added: 79727
2024-03-07 12:05 DenisChenu Status closed => feedback
2024-03-07 12:05 DenisChenu Resolution fixed => reopened
2024-03-07 12:05 DenisChenu Note Added: 79754
2024-03-07 12:05 DenisChenu Status feedback => assigned
2024-03-07 12:19 DenisChenu Assigned To DenisChenu => lajosarpad
2024-03-07 12:19 DenisChenu Status assigned => ready for code review
2024-03-07 12:19 DenisChenu Note Added: 79755
2024-03-11 15:17 LimeBot Note Added: 79772
2024-03-11 15:17 LimeBot Status ready for code review => closed
2024-03-11 15:17 LimeBot Resolution reopened => fixed
2024-03-23 11:14 JanE Issue Monitored: JanE
2024-03-23 11:14 JanE Bug heat 6 => 8
2024-04-01 11:09 DenisChenu Relationship added related to 19504
2024-04-16 13:55 DenisChenu Changeset attached => LimeSurvey 5.x c6bed762
2024-04-16 13:55 DenisChenu Changeset attached => LimeSurvey 5.x c6bed762
2024-04-16 13:55 DenisChenu Changeset attached => LimeSurvey 5.x 16c8acb2
2024-04-16 13:55 DenisChenu Changeset attached => LimeSurvey 5.x 16c8acb2
2024-04-16 13:55 DenisChenu Note Added: 79932
2024-04-16 13:55 DenisChenu Note Added: 79933
2024-04-16 13:55 DenisChenu Assigned To lajosarpad => DenisChenu
2024-04-16 13:55 DenisChenu Assigned To lajosarpad => DenisChenu
2024-04-16 14:31 tibor.pacalat Bug heat 8 => 14