spine-tools / Spine-Database-API

Database interface to Spine generic data model
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
6 stars 5 forks source link

Optimise purging #262

Closed soininen closed 5 months ago

soininen commented 11 months ago

But also, maybe it is a mistake to implement purge_items based on remove_items, maybe purge should be its own operation? Like mark a table as purged in the cache, and then delete the entire contents of that table in the DB when committing. This would save enormous time eventually if the user purges a huge table. It is actually almost ridiculous to fetch all the rows just to say, okay, now remove them all.

Originally posted by @manuelma in https://github.com/spine-tools/Spine-Database-API/issues/261#issuecomment-1707885146

manuelma commented 5 months ago

I think the lazy purge is working just fine? Will close, new issues will come out naturally if bugs.