-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Whilst running the report, I found with around 4 million records in the local_csp table, the report would fall over at times.
Drilling down further into the error and sql query - found this one was causing some grief
https://github.com/catalyst/moodle-local_csp/blob/master/classes/table/csp_report.php#L178-L179
It would be good to add an index for both violateddirective and blockeddomain columns to speed up the query
Tested locally, Postgres was fine and was able to add index to those fields. However, when trying to add an index to those fields in MySQL came across this error
Specified key was too long; max key length is 3072 bytes.
After a chat with Brendan, a thought was converting the column to text to add an index.
I need to re-import the data again locally from prod and will test converting the columns to text and adding an index. Will create a PR with that shortly.