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

[BUG] - Degradation caused by DatabaseIntrospection.get_table_list #370

Closed
royabend opened this issue Mar 26, 2024 · 3 comments
Closed

[BUG] - Degradation caused by DatabaseIntrospection.get_table_list #370

royabend opened this issue Mar 26, 2024 · 3 comments

Comments

@royabend
Copy link

Software versions

  • Django: 3.2.25
  • mssql-django: 1.4
  • python: 3.9.18
  • SQL Server: Microsoft.Sql/servers version 12.0
  • OS: Linux amd64

Problem description and steps to reproduce
In your recent PR, a change was made to the query within DatabaseIntrospection.get_table_list, introducing complexity such as JOINs to support database comments. This modification has resulted in a significant increase in CPU usage, particularly noticeable on large database schemas. Upon investigation, it was found that the complex query is causing our database to consistently utilize over 90% CPU, leading to performance degradation.

Given that DatabaseIntrospection.get_table_list is utilized extensively within Django's source code, avoiding its usage isn't feasible. Therefore, I propose adding an option to exclude database comments retrieval, potentially by checking DatabaseFeatures.supports_comments within the get_table_list method. This would provide a solution for mitigating the performance impact caused by the complex query.

Thank you for considering this enhancement.

@mShan0
Copy link
Contributor

mShan0 commented Mar 27, 2024

Thanks for raising this. Will look into this further

@royabend
Copy link
Author

royabend commented Apr 7, 2024

Thanks! Is there an estimation for the fix release?

@mShan0
Copy link
Contributor

mShan0 commented Apr 26, 2024

we just released this in version 1.5

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

No branches or pull requests

3 participants