drbowen wrote on Thursday, March 31, 2011:
The LAN that has 10 gigabit cat 6 ethernet cables, 1 gigabit switches, and 1 gigabit ethernet cards on the production server.
My main workstation has twin Phenom 64 bit chips with 2 gigabytes of ram, and a video card that runs 256 megabytes of memory (512 in Windows). Ubuntu 10.1 patched up to current.
The server has 8 gigabytes of RAM, quad 64 bit Opteron chips Ubuntu 10.1 patched up to current. There are 4 Seagate Barracuda (7200 RPM I think) x 1 terabyte hard drives in a RAID 5 configuration with 3 terabytes of working hard drive space.
My version is actually 4.0 dev-tip from about March 14th.
The encounter.php length of time to complete is clearly related the length of time the patient has been coming to the office and how many times a year they come to the office. So if they justed started coming to the office and there is only one visit this is lightning fast.
As the time of belonging to the practice increases and as the number of office visits increases the length of the query gets longer and longer. Since I am the senior member in my group and many of my patients have been coming since we started on OpenEMR in the fall of 2003, I have a large number percentage wise of patients that have visits all the way back to 2004. 20 visits per year x 7 years = 140 results.
Jeremy Wallace measured how many times the encounter.php script accesses the database to complete the page. He measured 900 individual accesses to the database to complete the page on one of these lengthier queries.
The old behavior of encounter.php was to limit the number of results returned to about 15. This was the behavior I believe in version 3.0.1. This was changed to return all results at least in 3.2 and also in 4.0. As far as I know none of the versions have the indices built to help the query run faster.
I work on a very fast net-work, with a fast server with lots of resources, at a fast work station. I understand how to make it easier for me to access individual work stations.
The reason I started this thread is that I don’t think it is reasonable for this query to be accessing the database 900 separate times and taking 45-60 seconds (unmodified behavior in version 4.0.0). I posted this because I think this cuts into my productivity, it will affect the productivity of every practitioner that uses OpenEMR, and I think this query needs to be fixed. At the very least the main distribution ought to have the tables indexed. Tony McCormick suggested that turning the length the query back and forth to “15 results” or “all results” could be configured in the globals so that the end user could select which length they prefer.
Samuel T. Bowen, MD
http://www.oemr.org