CKAN version
2.9.6, master
Describe the bug
Table resource_view needs a index on column resource_id.
Steps to reproduce
In a big CKAN database (500k packages) run the query
begin;
explain (analyze,buffers,timing)
delete from resource where package_id = [###];
rollback;
...
Trigger for constraint resource_view_resource_id_fkey: time=68.124 calls=6
Expected behavior
CREATE INDEX idx_view_resource_id
ON resource_view(resource_id);
After the index added, the time dropped from 68.124 to 0.420, that is 170 times faster.
Additional details
This will greatly reduce time spent when clearing a big harvest source.
CKAN version
2.9.6, master
Describe the bug
Table
resource_viewneeds a index on columnresource_id.Steps to reproduce
In a big CKAN database (500k packages) run the query
Expected behavior
After the index added, the time dropped from 68.124 to 0.420, that is 170 times faster.
Additional details
This will greatly reduce time spent when clearing a big harvest source.