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

Improve tool_filter performance #176

Closed soininen closed 2 years ago

soininen commented 2 years ago

tool_filter can get really slow with large databases because it makes the entity_sq query becomes pretty complicated. One way to speed up the filter is to cache the entity ids that pass the filter into a temporary table and then join that table with the original entity_sq.

soininen commented 2 years ago

Resolved in 58379e7df46f0939b3b68193a5bdaec55d7a243f