Viewing/creating an invoice takes long to load - 7.

drhoo

New Member
I'm currently on 7.1.2, PHP: 8.4 (have tried 8.5) and my php.ini is all optimised for maximum speed.
When I click on an invoice for a client or trying to create a single invoice, there's a noticeable lag (around 6-8 secs) compared to version 6.
Any ideas?
 
I wouldn't recommend fiddling with your database until CE team confirms - I manage my own server, but nowhere as knowledgeable as Clientexct developers.

UPDATE – SOLVED: Slow Create/Edit Invoice Pages

I've managed to significantly improve the loading speed of the Create/Edit Invoice pages in ClientExec 7.2.2.

Environment: PHP 8.5, MySQL 8.4.13, cPanel/WHM.

After looking into MySQL's slow query log, I discovered that ClientExec was repeatedly querying the invoiceentry table (approximately 408,000 records) without an index on billingtypeid.

Each query was scanning the entire table, contributing to invoice pages taking around 14–15 seconds to load.

Solution:

After backing up the database (just in case), I added the missing index using:

SET SESSION sql_mode =
REPLACE(
REPLACE(@@SESSION.sql_mode, 'NO_ZERO_IN_DATE,', ''),
'NO_ZERO_DATE,',
''
);

ALTER TABLE invoiceentry
ADD INDEX idx_invoiceentry_billingtypeid (billingtypeid);
The temporary SQL mode adjustment was necessary for compatibility with the existing database schema.

Results:

  • Estimated rows examined per query reduced from 407,977 to 304.
  • Invoice page loading improved significantly.
  • No ClientExec PHP modifications.
  • No existing records changed.
  • No permanent MySQL configuration changes.
Hopefully, this helps anyone experiencing similar invoice performance issues.

Note: Check your existing indexes and take a database backup before applying this change and wait until Matt comments
:)
 
Back
Top