Skip to content
Founding beta: 7 of 50 free spots leftClaim yours

The invoice list takes seconds to load a full page

Bug huntEasyPython · FastAPIDatabasePerformanceAPI25 min

BILL-519: Invoice list takes several seconds to load for a full page

Ticket #54377 · email · Medium

Component: Invoice list (support's guess)

From: Tomas Berg, operations, Brightwell Dental Supplies · Received: Tue 27 Oct, 8:55 am

Hi, the invoices page has become really slow for us. We keep it open all day and set it to show 100 invoices per page. It used to come up almost at once; now it takes about three seconds every time, and a bit over one second even with 25 per page. Nothing else in Ledgerly feels slow, and opening a single invoice is fine. We have about 420 invoices in total. It started getting worse after you added the "Paid" and "Balance" columns to the list a few weeks ago, and it keeps getting a bit worse as we send more invoices. Our accountants also hate that the page freezes when they filter by Sent. Can you speed it up? We do not want to lose those columns, we use them every day.

Tomas

Support note (Dana K.): I reproduced it on Tomas's account: the page really does take about 3 s at 100 rows, and the time seems to follow the number of rows on the page, not the size of the account (a 5-row page is quick). Monitoring captured the database statements for one request, see the attachments. Servers are not busy and the database is healthy. Single-invoice routes are fine.

Attachments: attachments/db-statement-log-one-request.txt (database statements for one list request), attachments/invoice-page-load-times.csv (Tomas's page load timings over the last six weeks).

Triage (support), written up for engineering:

Symptom

The invoice list gets slower the more rows a page shows (and a little slower as the account grows), most noticeably at 100 rows per page and with the Sent filter on.

Steps to reproduce

  1. Use an organization with a few hundred invoices, most of them with one or more payments recorded.
  2. Open the invoice list with 100 rows per page (and again with 5 rows per page), also with the status filter set to Sent.
  3. Compare how long the 100-row page takes with the 5-row page.

Expected

The list takes roughly the same time for 5 and for 100 rows, shows the same figures as today (paid, balance, number of payments, last payment) and is just as correct, including for platform staff and for the status filter.

Actual

The 100-row page takes several seconds; the load time grows with the number of rows on the page. The figures themselves are correct.

Ask: make the invoice list fast again without removing the Paid / Balance columns or changing what any invoice route returns.

Your workspace has the app's small demo data, not the customer's. The attachments show what happened in production.

© AICodingRound. Ticket text for practice on this site; see Terms.

How it works

  1. 1Fix the problemin a real codebase.
  2. 2Use your ownAI, or none.
  3. 3Submit, then answera few short questions.
  4. 4Get your gradeand feedback.

Guides that use this problem

All guides

More on Ledgerly billing

View all

Related problems

View all