-
Notifications
You must be signed in to change notification settings - Fork 578
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
Thumbnail Rendering Performance Issue with directory listing #1462
Comments
Hi, I finally had some time to dig deeper into this issue and discovered that foreign keys, which should have already been indexed, were present. Writing some tests made me realize that the indexes I was adding were indeed improving performance, but they should have been there from the beginning. Additionally, I wrote a test to compare indexes and found that I was duplicating indexes on the test database rather than the actual database. In summary, there seems to be a problem with the project's database where these indexes were missing. I decided to add the necessary indexes. I'm including the SQL here in case it helps anyone (though ideally, you won't need it 😅). CREATE INDEX IF NOT EXISTS easy_thumbnails_thumbnail_source_id_5b57bc77 ON easy_thumbnails_thumbnail (source_id);
CREATE INDEX IF NOT EXISTS filer_file_owner_id_b9e32671 ON filer_file (owner_id); |
@CuriousLearner Thanks for the update! I'd love to keep this open for the moment, to check if we need to add indexes. This probably needs to happen through Django's ORM, and might also affect easy thumbnails. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi,
I'm encountering a performance bottleneck while utilizing django-filer version 3.1.1 alongside Django version 4.2.13 and easy_thumbnails version 2.8.5.
The issue arises when attempting to render thumbnails for images within directories, particularly noticeable during the directory listing view. Upon investigation using django-debug-toolbar, it appears that the SQL query execution time is excessively prolonged, leading to server timeouts.
Here's a snapshot of the SQL query generated by the directory listing view:
The SQL query formed by the view above is as follows:
To mitigate this performance concern, I've created two indexes which seem to have a positive impact on query execution time:
After Index creation, the query time was reduced significantly:
However, despite these optimizations, I'm uncertain if there are additional steps or considerations I may have overlooked. Your insights into resolving this performance issue would be greatly appreciated.
Thank you for your attention to this matter.
The text was updated successfully, but these errors were encountered: