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

Performance issue when model includes relation to large table #796

Closed
cris-b opened this issue Aug 6, 2018 · 3 comments
Closed

Performance issue when model includes relation to large table #796

cris-b opened this issue Aug 6, 2018 · 3 comments
Labels

Comments

@cris-b
Copy link

cris-b commented Aug 6, 2018

I have a one-to-one table model, with a large number of rows in each (600k).

If I add an sqlalchemy relationship to the model, then I get horrendously slow performance of the view in FAB. This hapens regardless of whether I include any columns from the related model in the list etc.

I worked out this is because FAB is trying to collect the values of the entire table mentioned in the relation for the search field autopopulation. If I specify 'search_columns' in the view and exclude this releation it all works blazingly fast.

It's strange that the columns on the main view are not fetched in full, but those in relations are which makes me think this may be a bug. In any case it might be best to add this somewhere in the documentation as this caused me quite a lot of head scratching!

@stale
Copy link

stale bot commented Jan 14, 2019

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.

@stale stale bot added the stale label Jan 14, 2019
@stale stale bot closed this as completed Jan 15, 2019
@hell-io
Copy link

hell-io commented Aug 1, 2019

It definitely would be useful to mention this 'large related tables' issue in the docs. It costed me a couple of days of digging into the FAB's and my own code to find why a simple list view took 12 seconds to load. Might be a good idea to completely exclude related fields from 'search_columns' by default.

@Th4nat0s
Copy link

I did not achieve to create a filterview and an extra search field to replace the huge option/form generated by defaults with relation objet when having a high nubmer of recorde

A simple text seach in fab. could be an idea.

If someone got an hint.

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

No branches or pull requests

3 participants