I have been noticing and also receiving complaints from our physicians regarding performance. We at Pohnpei CHC had been using OpenEMR since 2016. We are currenty on version 7.0.2. I created a virtual machine and installed version 8.4.1. I backed up db and restored and upgraded db to 8.4.1. logged in and clicked on finder. I took more than 1 minute to load the page(finder page with list of all patients). My system resources are not busy. This was never an issue with the 7.0.2. When the page finally loads, It takes longer to load patient dashboard with patients with long medical history than patiens that only visited a view times. The problem with this is when the doctor is finished with one patient and a new patient steps in, the doctor, instead of closing the previous patients dashboard, he clicks on finder and search for the patient now sitting in front of him. He then clicks the patients name and the finder closes and dashboard appear. not realizing that the dashboard belongs the previous patientt and he clicks on the new encounter creating a new encounter for the previous patient. After a few seconds, which feels like eternity when the patient is someone with long health record, the dashboard for the right current patient appears. Tried disabling active and passive reminders and no noticable change. It will be nice to have the dashboard load instantly and allow the dashboard widgets to load afterwards. Or, is there a way to speed things up in the configurations? The >1 minute wait only happens in my new install and not the version 7. Once the long wait is over, it loads normally like the version 7.0.2. After a while, it does it again. Is there a new background service in the version 8 that prevents the finder page to load right away until the service or task is complete?
Thanks for the detail. On your question about a background service: version 8 runs its background services (messaging, email, and one that fills in record ids) from the server’s scheduler, not from page loads, and I couldn’t find anything that makes the finder wait for one. What did change is that 8.x gives ids to 11 more kinds of records than 7.0.2 (drug sales, issue links and specimens among them). Some dashboard sections fill in missing ones as they read, which can be slow the first times on records going back to 2016.
For the finder’s minute, two quick checks on the 8.4.1 VM during a slow load would show what it’s waiting on, and whether a setting can help:
- In the browser, press F12, open the Network tab, then open the finder. The request that takes the minute names the culprit.
- In MySQL, run SHOW FULL PROCESSLIST; to see any query that’s running or waiting on a lock.
If you post what they show, we can narrow it down.
The wrong-patient encounter is serious on its own: the previous patient’s dashboard stays clickable while the next one loads. If you’re OK with it, we’ll open an issue so it gets fixed, and your idea of showing the dashboard first and loading the widgets after would help there too. Until then, closing the previous patient’s dashboard before using the finder, as you described, avoids it.
— Claude, writing for Seth
You’re having environment problem. I help another with this issue but on xampp and I believe a VM.
Search forum for topic as well as others issues concerning performance.
I believe something to do with mysql.
I’d check but PHP may not let you because of session write. I don’t remember what everything is set at currently.
Hi @Kanoberson, the pattern you describe (over a minute the first time, normal after that, then slow again later) is a classic sign of an undersized InnoDB buffer pool on a new database server, rather than anything 8.4.1 is doing in the background.
A fresh MySQL/MariaDB install defaults innodb_buffer_pool_size to 128MB. With a database going back to 2016, the first finder load has to read patient_data from disk. Once it’s cached it’s fast, until other activity (dashboards, audit log writes) pushes it out of that small pool and the next load is cold again. Disk wait doesn’t show up as CPU load, which fits “system resources are not busy.”
Could you run these on the 8.4.1 VM and post the results?
SELECT @@innodb_buffer_pool_size/1024/1024 AS pool_mb;
SELECT table_schema, ROUND(SUM(data_length+index_length)/1024/1024) AS mb
FROM information_schema.tables GROUP BY table_schema;
SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_read%';
It would also help to run the first one on your 7.0.2 server for comparison, and to know how much RAM the VM has.
If the pool is 128MB and the database is several GB, set innodb_buffer_pool_size in your MySQL/MariaDB config to something closer to the data size (leaving room for Apache/PHP and the OS, roughly 50 to 70% of RAM on a dedicated box), then restart the database. I just made the same change on a couple of 8.4.1 sites and it made a big difference.
If it’s still slow after that, SC’s suggestions (the F12 Network tab and SHOW FULL PROCESSLIST; during a slow load) will show what it’s waiting on.
You can tell who is the lazy one in this topic! ![]()
I’ve been trying very hard to figure this out on my own without being 100 percent of what was doing. I try so hard to understand it. I learn better this way( hands on). I’ve since moved to a physical server machine, an HP Proliant DL380 gen 9 with 32 gb ram. Increased my buffer_pool_size to more than my database size(about 11,322 mb)( I use Mariadb by the way).
To respond to your requests:
buffer pool: 12,288 mb
my sqlconf.php points to staging.
It only happens intermittently but is consistent. Some of my research suggested UUID service whick runs every 4 hours that when it runs, other things will wait until it completes and since my db is large it may take a while for the service to finish. I could not or do not know how to verify or even fix this. Therefore I decided to put this on this forum to see if anyone else have the same problem.
Thank you,
You can disable that background service and test here is a query for you to run.
UPDATEbackground_servicesSETactive= '0' WHEREbackground_services.name= 'UUID_Service';
I don’t know if service is monitored and auto turned on however. You’ll have to watch. I’m thinking background service runs all enabled tasks every 2 minutes.
You’ll need to stop the service and wait for existing UUID to finish running before testing your dashboard.
I think last time Brady and I tuned openemr was 7.0.0 and setup a prevent a session write enabled on a script start. If one is enabled it will prevent any other scripts from starting until released so basically can harm performance if those write locks aren’t remove asap when not needed. We prob need to do another look see. I think I saw an issue by someone a while back to fix some of them.
My production server is still 7.0.2. I have not upgraded and migrated my production. All I am working on now is my testing server which is the current version. I did some testing and probing on my test server with assistance of claude desktop and asked it to explain the results. I’ve tested what it recommended as fix and it seems to work but I will not be the judge of it so am sharing what I did if it will make any sense. I will not upgrade until my issue is resolved. I will leave it to you guys to guide me with the solution or show me if I missed something. So here it is:
perf(db): composite index on uuid_mapping to speed up UUID_Service
Pohnpei CHC, OpenEMR 8.4.0, October 2026. Measured on the test server on October 10, 2026.
Status as of November 7, 2026: the test server was found running stock OpenEMR 8.4.1, restored without this index, and
8.4.1’s own schema (sql/database.sql) does not include it either (uuid_mapping still has only the target_uuid key). So the
index is not currently applied anywhere that I know of, and it still needs to be added to any server that has this problem.
Summary
UUID_Service took about 78 seconds per run on our data. Adding one composite index to uuid_mapping
cut it to about 19 seconds. The index changes no data and no UUID; it only makes one search faster.
Problem
UUID_Service runs every 240 minutes. Each run calls UuidMapping::createMissingResourceUuidsStep() once per mapped code,
24 times in all, and 15 of those are for form_vitals. Each call is an anti-join of the source table against uuid_mapping
to find records that still lack a mapping row. Each form_vitals call took about 4.7 s, even though no rows were missing.
Why uuid_mapping is large, and why vitals dominate it
FHIR models each vital sign as its own Observation resource, but OpenEMR stores a whole vitals form as one form_vitals row.
To give each measurement a stable ID, uuid_mapping holds one row per code per vitals row:
resource = 'Observation'table = 'form_vitals'target_uuid= the vitals row’s UUIDresource_path = 'category=vital-signs&code=<LOINC code>'
There are 15 codes, so 172,646 vitals rows give about 2.59 million mapping rows (2,603,580 observed), about 2.8 million in the
whole table. Rows exist for all 15 codes even when a measurement was not taken, because the code does not skip empty values.
Every new vitals form adds 15 rows. Other mapped records are far smaller: patients about one row per type, history_data two
codes per row, staff and facilities a handful.
Root cause
- The job does not remember what it has already done. Every run re-verifies every record, so a fully populated table still
pays the full cost. - The only usable index was single-column
target_uuid.EXPLAINshowedkey = target_uuidand about 12 rows per lookup. - The join also filters on
resourceandresource_path, which were not indexed. For each vitals row the engine read about
12 candidate rows and discarded 11 of them. - That is about 2 million index lookups and 2.6 million row reads per query, repeated 15 times.
Fix
ALTER TABLE `uuid_mapping`
ADD INDEX IF NOT EXISTS `idx_target_res_path` (`target_uuid`, `resource`(32), `resource_path`(64)),
ALGORITHM = INPLACE, LOCK = NONE;
Design choices:
target_uuid,resourceandresource_pathare all equality predicates in the join, so column order is not about range scans.
target_uuidgoes first because it is the join column and the most selective.resourceandresource_patharevarchar(255)inutf8mb4. Prefix lengths (32 and 64) keep the key small. The WHERE clause
re-checks the full value, so results are unaffected.ALGORITHM = INPLACE, LOCK = NONEmakes it an online change.IF NOT EXISTSmakes it safe to re-run.
Result (measured on the test server, read-only SELECTs)
| Measure | Before | After |
|---|---|---|
EXPLAIN for a form_vitals check |
key = target_uuid, rows ~ 12 |
key = idx_target_res_path, rows = 1 |
One form_vitals check (each of 15) |
about 4.7 s | about 0.76 s |
| Whole mapping step (24 queries) | about 72 s | about 12 s |
Whole UUID_Service run |
about 78 s | about 19 s |
Every check still returned missing = 0 before and after, so the results are identical.
Not changed by this index: the separate uuid_mapping / uuid_registry anti-join (createMissingMappedUuids(), about 4.6 s on a
4.7-million-row uuid_registry). It is part of the remaining 19 seconds.
Trade-offs
- Extra disk space and buffer-pool memory for one more index. Roughly 200-300 MB by estimate; the real size was not measured
because the app’s database user cannot read the statistics tables. - Slightly slower inserts into
uuid_mapping, which only grows when new records are created. - A schema addition outside OpenEMR’s own migrations. An OpenEMR upgrade will not remove it and will not manage it.
Rollout, check and rollback
Create it (took about 17 s on 2.8 million rows; safe while OpenEMR is in use; safe to re-run):
ALTER TABLE `uuid_mapping`
ADD INDEX IF NOT EXISTS `idx_target_res_path` (`target_uuid`, `resource`(32), `resource_path`(64)),
ALGORITHM = INPLACE, LOCK = NONE;
Check that it exists (should list three columns: target_uuid, resource, resource_path):
SHOW INDEX FROM uuid_mapping WHERE Key_name = 'idx_target_res_path';
Check that the optimizer uses it (look for key = idx_target_res_path on the uuid_mapping row):
EXPLAIN SELECT fv.uuid
FROM form_vitals fv
LEFT OUTER JOIN uuid_mapping m
ON fv.uuid = m.target_uuid AND m.resource = 'Observation' AND m.resource_path = 'category=vital-signs&code=8867-4'
WHERE m.uuid IS NULL AND fv.uuid IS NOT NULL
LIMIT 1000;
Roll back:
ALTER TABLE uuid_mapping DROP INDEX idx_target_res_path;
Related, separate fix
The same job was also holding up other screens because the browser’s background poll held the user’s session lock for the whole run.
That was a code change to the $run route in apis/routes/_rest_routes_standard.inc.php and is not part of this index. See
docs/dashboard-performance-fixes-2026-09.md (Fixes 6 and 7) and docs/finder-slow-load-fix-runbook.md.
The script for this index is also in docs/uuid_mapping_index.sql.
Kanoberson, thank you. That’s careful work, and it corrects something I said earlier: version 8’s main screen does start the background services itself, through the API on a timer (interface/main/tabs/main.php), so a long UUID_Service run can hold up the next page. I was wrong to say they only run from the scheduler.
Your index finding holds on current OpenEMR too: uuid_mapping still has only single-column keys, and nothing on resource_path, so that lookup can’t narrow the way your composite index lets it. It’s now up as a pull request with your measurements and credit to you: openemr/openemr#15143. We checked it on MariaDB 12.3 and MySQL 8.4 at your scale (172,646 vitals): each vitals check went from about 2.3 to 0.5 seconds and 3.5 to 0.8 seconds, with identical results. It uses your index name, so a site that already ran your script skips it on upgrade. The session lock is the other half, which sjpadgett mentioned above.
— Claude, writing for Seth
@Kanoberson just wanted to find out if you were still having issues with upgrading. We reviewed and merged in that PR with the fixes on the indexes. You should be able to manually apply it to your system and see if that helps your performance.
Hi Kanoberson, great detective work on the uuid_mapping index, and good to see it merged as PR #15143. Before you move production off 7.0.2, two things that have saved our clients pain: rehearse the full upgrade on a copy of production at least twice and time every step, and let UUID_Service finish its first full run on the test copy before judging dashboard speed. That way you’ll know exactly what to expect on cut-over day.

