ckan / ckanext-harvest

Remote harvesting extension for CKAN
130 stars 203 forks source link

add index harvest_error_harvest_object_id_idx #514

Closed FuhuXia closed 1 year ago

FuhuXia commented 1 year ago

Table harvest_error needs an index on column harvest_object_id. Without it it takes too long to delete a harvest_object.

BEGIN;
EXPLAIN (analyze,buffers,timing)
DELETE FROM harvest_object WHERE id='2dce01ff-5168-400b-9698-3643a8dc3369';
ROLLBACK;

Before adding the index:

...
Trigger for constraint harvest_object_error_harvest_object_id_fkey: time=201.459 calls=1

After adding the index:

...
Trigger for constraint harvest_object_error_harvest_object_id_fkey: time=0.362 calls=1