bugGNU Health - Bugs: bug #61848, Created Invoices menu taking too...


You are not allowed to post comments on this tracker with your current authentication level.

bug #61848: Created Invoices menu taking too long to get invoices from database

Submitter:  Humberto Freitas <noosanon>
Submitted:  Tue 18 Jan 2022 07:57:12 PM UTC
Category:  Functionality Severity:  3 - Normal
Item Group:  None Status:  Ready For Test
Privacy:  Public Assigned to:  meanmicio
Open/Closed:  Open Release:  3.8.0
Module:  Health Services Component:  None

Fri 28 Jan 2022 05:01:59 PM UTC, comment #2: 

There is no need to bring all invoices related to health services.

I think the best is to restrict the domain search by default to the last month.  Any thing related to invoices involve expensive queries, and adding an extra functional field as in the case of the related services, even more.

Starting the 4.0, the action will restrict the domain to show all invoices which date of invoice within a month from the current date.

Please check

Have a great weekend!

Luis Falcon <meanmicio>
Group administrator
Wed 19 Jan 2022 11:46:07 AM UTC, comment #1: 

Thank you, Humberto!

For what we discuss yesterday in Matrix, you have over 35000 invoices.
Due to the fact that most processes sent from the client are executed in the foreground, the client will become "unresponsive" until process finishes.

It looks like is volume dependent, so I will check table indices, search domains and methods that might be slowing down the query.

We'll get back to you soon :)

Thanks again for the feedback!

Luis Falcon <meanmicio>
Group administrator
Tue 18 Jan 2022 07:57:12 PM UTC, original submission:  

Client: Tryton Client, GNU Health client
Server: GNU health 3.8
OS: Debian 11
Database: Postgresql 13

Hello guys, I hope everything is all right with you.

I'm having a really strange problem which happens when I click on the Created Invoices menu inside Health Services menu.

It takes more than a minute to get the data from the database, and while it waits for the data the client program hangs unresponsive unlike any other menu.

When I tried to click on other menus in which returns more data than the Created Invoices menu, for example the client invoices inside the Financial Menu from the account module, the client program behaves as it should, returning the data normally even though it has more invoices than the Created Invoices menu have. I've also tried to click on other menu like the prescriptions menu and it returns more data than the Created Invoices and it behaves normally.

Another thing that happens is that, when I click on the Created Invoices menu and run htop program to check the resources consumed, the CPU usage goes up to 100% for the duration of all query.

Even though I tried to decrease the Search limit to 50, it still take much time to get the data from the database.

It's also important to note that, it's only this menu that has this problem.

I attached a photo with the htop running so you can see the query running on the database and its consumption.

I hope you guys can help me with this.

Thank you so much for all your work.

Happy new year for all.


Humberto Freitas <noosanon>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by meanmicio (Posted a comment)
  • -email is unavailable- added by noosanon (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-28 meanmicio StatusNone Ready For Test
    2022-01-19 meanmicio Assigned toNone meanmicio
        ReleaseNone 3.8.0

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code