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

Search Availability bottleneck in bat_facets #48

Open
borisbsu opened this issue Feb 20, 2018 · 2 comments
Open

Search Availability bottleneck in bat_facets #48

borisbsu opened this issue Feb 20, 2018 · 2 comments

Comments

@borisbsu
Copy link
Contributor

I have noticed, that in bat_facets module you load all BAT types one by one, then in foreach cycle you load units states for each type to check if it matches search criteria: start_date, end_date, valid_states.

In total you execute 4*N database queries where N is the number of BAT types. It's fine when N is small, but in service where N > 1000 or more this is a real bottleneck. E.g. on my dev environment with 900 types the search time > 7 sec. That's terrible and doesn't suit for real booking systems having thousands of properties.
In RfA it is even worse - you load roomify_property, then corresponding bat_type, and then unit states. So it's

Have you thought about optimizing search availability algorithm? In my opinion the search should be done on database side, not on Drupal backend.

@acrollet
Copy link
Member

@borisbsu thanks for the feedback - as with many open source projects, there's a real funding issue. We'd happily review a pull request or do sponsored development on this issue.

@borisbsu
Copy link
Contributor Author

@acrollet Ok. I have an idea how to handle search on db side. Hope I will find some time to create a PR for it.

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