SQLite does not create indexes in the tables referencing foreign keys, they need to be added manually:
softhsm --init-token --slot 0 --label OpenDNSSEC --pin 1234 --so-pin 1234
ods-ksmutil setup
sqlite3 /var/opendnssec/kasp.db
CREATE INDEX idx1 on dnsseckeys ( zone_id );
CREATE INDEX idx2 on dnsseckeys ( keypair_id );
CREATE INDEX idx3 on keypairs ( securitymodule_id );
CREATE INDEX idx4 on keypairs ( policy_id );
CREATE INDEX idx5 on zones ( policy_id );
CREATE INDEX idx6 on parameters ( category_id );
CREATE INDEX idx7 on parameters_policies ( parameter_id );
CREATE INDEX idx8 on parameters_policies ( policy_id );
ods-control enforcer start
My tests with 1000 zones, clean setup, run enforcer and create ZSK and signconfs:
without indexes: killed it at 283 zones, took 14 minutes. Was getting slower and slower so 1000 zones might have taken many hours.
with indexes: 1 min 5 seconds !
speed up: unknown, maybe 100000% + ?