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

Taking too long time on Huge Tables. #1

Closed
satishvmadala opened this issue Jul 4, 2016 · 3 comments
Closed

Taking too long time on Huge Tables. #1

satishvmadala opened this issue Jul 4, 2016 · 3 comments

Comments

@satishvmadala
Copy link

Hey! I have a table with 1.4 Million rows. I used RequestConfig inside my view function, like this to load Data onto DjangoTables2 without filter search:

sales_data = SalesTable(sale.objects.all().order_by('-time'))
RequestConfig(request,paginate={'per_page': 50}).configure(sales_data)

This method takes almost no time to load the data and pagination also super fast. Now, i want to implement filter search on columns and used your example, which results in consuming total memory (4 GB on dev machine) and yet too long time, sometimes crashing.

Is there a way, i achieve best of both? Speed data loading and filters?

Thanks!

@spapas
Copy link
Owner

spapas commented Jul 5, 2016

Hello @Mvsatish this seems to be a problem of django-filter -- I've opened the carltongibson/django-filter#442 issue there to see if there's a solution. Thanks for noticing this!

spapas added a commit that referenced this issue Jul 5, 2016
@spapas
Copy link
Owner

spapas commented Jul 5, 2016

Hello @Mvsatish , finally the issue is resolved! You need to use filter.qs as the table data instead of just filter and also use .count instead of |length to count the template items! Check my latest commit to see the changes that were needed.

Best regards,
Serafeim

@spapas spapas closed this as completed Jul 5, 2016
@satishvmadala
Copy link
Author

@spapas Thanks! This is fantastic. 👍

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

2 participants