HTTP-APIs / hydrus

REST server - Flask Hydra-powered for Semantic Web
https://pypi.org/project/hydrus/
MIT License
195 stars 130 forks source link

Optimise filtered resource query #588

Closed Mec-iS closed 3 years ago

Mec-iS commented 3 years ago

This code contains a nested for and runs filtering operations at the Python level: https://github.com/HTTP-APIs/hydrus/blob/34c909e26e58bf2aee279391c7560d8536ff9f91/hydrus/data/resource_based_classes.py#L311 We should look into it and refactor it so to move the operations at the database level via proper joining and where clauses.

Mec-iS commented 3 years ago

the code loops thorugh parameters to build the query, not on actual database rows. So it is ok.