Most of the SQL WHERE statements are run on a small number of fields ("key", "from_id", "to_id"). Perhaps SQL operations could run faster if we created indices for these fields in the DB. This should at least work with the GRASS SQLite and PostgreSQL backends. If it fails (perhaps DB backend does not support index generation or is read-only), we can still go ahead, but issue a warning that performance will suffer.
Most of the SQL WHERE statements are run on a small number of fields ("key", "from_id", "to_id"). Perhaps SQL operations could run faster if we created indices for these fields in the DB. This should at least work with the GRASS SQLite and PostgreSQL backends. If it fails (perhaps DB backend does not support index generation or is read-only), we can still go ahead, but issue a warning that performance will suffer.