Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimise SQL queries #159

Closed
zorun opened this issue Dec 31, 2016 · 1 comment · Fixed by #949
Closed

Optimise SQL queries #159

zorun opened this issue Dec 31, 2016 · 1 comment · Fixed by #949

Comments

@zorun
Copy link
Collaborator

zorun commented Dec 31, 2016

A project with a few hundreds bills loads quite slowly: rendering the list_bills view takes several seconds.

Debugging with the Flask toolbar, it seems that the number of SQL queries issued by list_bills is very high: number of bills * number of owers. For instance, with 100 bills and an average of 5 owers for each bill, there will be 500 SQL queries.

See also #156 for some initial thoughts on this issue

@zorun
Copy link
Collaborator Author

zorun commented Dec 31, 2016

Most of the SQL queries are actually done by the sidebar, presumably to compute the balance. The list of bills itself generates approximately one query per bill (which is still too much).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants