You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
def self.known_subclasses(_table = table_name, _type_column = inheritance_column)
InvoicingLineItem.descendants
end
def self.known_subclasses(_table = table_name, _type_column = inheritance_column)
InvoicingLedgerItem.descendants
end
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:
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: