Refactor queries on relations and iteration on results

Registered by Nikolay Markov

First, we need to debug and refactor some places in code which include work with related models. Now SQLAlchemy does too many queries, which really slows all the process.
Second, SQLAlchemy always loads all objects from queries into memory, and this can be solved on psycopg2 by using .yield_per() with queries. Then it will use Postgresql cursor and iterate through results without huge memory consumption.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Low
Drafter:
Nikolay Markov
Direction:
Approved
Assignee:
Nikolay Markov
Definition:
Approved
Series goal:
Accepted for 5.1.x
Implementation:
Implemented
Milestone target:
milestone icon 5.1
Started by
Nikolay Markov
Completed by
Nikolay Markov

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.