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

Fix performance problems #303

Merged
merged 1 commit into from
Mar 9, 2018
Merged

Fix performance problems #303

merged 1 commit into from
Mar 9, 2018

Conversation

hwbllmnn
Copy link
Member

When requesting applications in certain projects with their own model extensions, performance will sometimes drop dramatically. The problematic SQL statements had the following characteristics:

  • they used a ridiculous amount of left outer joins (more than 80)
  • they were joining over a couple of (select ... union ... union) subselects

In order to reduce the amount of joins this PR removes some of the fetch mode annotations (or changes them to subselect) (in order to avoid too many joins at once) and changes the inheritance strategy for all related classes to joined instead of table_per_class (in order to avoid the unions).

Please note that this will result in changed table structures, so we should only merge this after a new release.

@terrestris/devs please review

@marcjansen
Copy link
Member

We had this this forth and back... really annoying. I tend to think that inheritance isn't the right approach here. If possiible I'd delay merging this until we have feednack from @buehner

@ahennr ahennr requested a review from buehner March 7, 2018 08:44
@buehner
Copy link
Member

buehner commented Mar 7, 2018

As the changes will result in changed table structures, this is a hard topic regarding backwards-compatability, right? As long as we start new projects or we can boot in CREATE-mode, this would be fine.

I love performance enhancements, but i dont like breaking the backwards-compatibilty. I dont have a strong opinion right now.

This change should result in a 1.x.x release, right? Maybe we can still maintain a 0.x.x branch for backwards compatibility. What do you think?

@hwbllmnn
Copy link
Member Author

hwbllmnn commented Mar 7, 2018

You're right about that. I think doing a 1.x and maintaining a 0.1.x branch for backwards compatibility sounds like the right thing to do.

Just note that this actually fixes scalability issues and doesn't just improve performance.

@marcjansen
Copy link
Member

Then please do the releases and proceed as discussed. Thanks everyone

@hwbllmnn hwbllmnn merged commit 855648b into terrestris:master Mar 9, 2018
@hwbllmnn hwbllmnn deleted the fix-performance branch March 9, 2018 07:45
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

Successfully merging this pull request may close these issues.

3 participants