benducke / Network-reconstruction-tools-for-GRASS-GIS

Node-based network model generator for GRASS GIS 7.x (and QGIS 3.x)
GNU General Public License v3.0
4 stars 1 forks source link

Create indices for faster SQL operations #32

Closed benducke closed 1 year ago

benducke commented 3 years ago

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.

benducke commented 2 years ago

Functions add_index/del_index added.

benducke commented 1 year ago

Tested, but not really worth it in most cases. Replacing v.db.update by low-level DBMS operations with db.execute was for more effective.