No indexes on Formidable* tables, can cause MySQL to crash
Permalink Browser Info Environment
Just a heads up - if you receive a lot of form submissions, chances are when you go to "Formidable -> Reports" it'll hang and/or crash MySQL.
This is because there are no indexes on the data and one of the queries to view the table of submissions can be potentially huge and with no indexes it's going to load all of the answers every time in memory until it finds matches for each row.
I added indexes as follows;
Table: FormidableAnswers, Indexes: answerSetID, formID, elementID
Table: FormidableAnswerSets, Indexes: formID, temp, collectionID
Table: FormidableFormElements, Indexes: formID, layoutID
This simple change turned the query from 10 minutes (and sometimes killing MySQL) to 0.098 seconds!
Note to developer: I would optimise your queries for a future release :)
Cheers
James
This is because there are no indexes on the data and one of the queries to view the table of submissions can be potentially huge and with no indexes it's going to load all of the answers every time in memory until it finds matches for each row.
I added indexes as follows;
Table: FormidableAnswers, Indexes: answerSetID, formID, elementID
Table: FormidableAnswerSets, Indexes: formID, temp, collectionID
Table: FormidableFormElements, Indexes: formID, layoutID
This simple change turned the query from 10 minutes (and sometimes killing MySQL) to 0.098 seconds!
Note to developer: I would optimise your queries for a future release :)
Cheers
James
Type: | Discussion |
---|---|
Status: | Resolved |
Not sure which version you are running, but the later version should have indexes on them.
Best,
Corretje