-
Notifications
You must be signed in to change notification settings - Fork 76
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
known_subclasses _very_ slow in high throughput environments #13
Comments
@joegaudet there is updated version here https://github.com/code-mancers/invoicing. Can you try it and see if it works for your case. I can help you out with performance issues. |
I assume this is the one that's published to rubygems? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Guys,
Not sure if this is even still maintained, given the age of the last release.
I thought I'd let you know that the current implementation of know subclasses on ledger / line items is very slow on large tables. Our production ledge table has ~ 400k rows, and our line item table has 1M plus.
It took a bit of digging to find this method being the source of slow down.
The fix for us was simple, we added the following methods to our base classes for ledger / line item.
The cause of the slow down is a bit subtle, since we are constantly building invoices, that means we are inserting / deleting from the line_item / ledger_item table constantly. The method in teh gem for determining known subclasses:
SELECT DISTICT type from ...
Has to acquire a table look in order to determine the distinct set of entries for that table. This causes queueing all over the place.
Anyway thought you'd like to know, as there is a huge TODO left on the code that causes this select.
The text was updated successfully, but these errors were encountered: