Open MassonNN opened 1 year ago
We don't really need to get all rows from database if we want to get exactly one row with sqlalchemy methods. This has bad effect for database performance and need to be fixed.
https://github.com/MassonNN/masson-aiogram-template/blob/345e1b04649561e4bedf445e2d4b79554a870f56/src/db/repositories/abstract.py#L43
Add limit statement
Rationale
We don't really need to get all rows from database if we want to get exactly one row with sqlalchemy methods. This has bad effect for database performance and need to be fixed.
Where occurs
https://github.com/MassonNN/masson-aiogram-template/blob/345e1b04649561e4bedf445e2d4b79554a870f56/src/db/repositories/abstract.py#L43
How to fix
Add limit statement