ilabafrica / BLIS-BDH

Legacy BLIS implementation customised for Bungoma County Hospital.
1 stars 0 forks source link

Truncate transaction table. As per Rufus' advice #35

Closed briankip closed 10 years ago

briankip commented 10 years ago

We should truncate transaction tables, e.g external lab request, as this table will get larger and larger, and impact on the performance of BLIS, we don't need old data from this table.

How do you guys like this idea. What he does is every day he truncates data older than one month.

mapesa commented 10 years ago

There are other transaction tables: test, test_measure, specimen, audit trail tables. I think we need to study how we can roll the data in all these tables in such a way that it is quickly accessible if ever needed (if possible without techie intervention).

In the future the size of these tables will impact performance but at the moment we receive under 20K inserts a month (external_lab_requests) which is peanuts. The current total record count is just about 80K so the database is not about to become a bottle neck for BLIS (Bungoma). BLIS response times are fairly okay - any latency is more likely due to network instability and perhaps inefficient queries and less than adequate database optimizations.

We could still truncate (weekly/monthly/yearly) but perhaps we'd be better of benchmarking the present one first so as to know how much load it can take. Otherwise we'll be using a Ferrari when the upper speed limit is 20KPH. My 2cts ;)

briankip commented 10 years ago

Ha, nice analogy. Ok, I also think, it could be an issue in the future but we can handle it currently. Also check https://github.com/ilabafrica/BLIS-BDH/commit/a33fbc9c91654057a5c485740c4971e96d6e2d04 I made some adjustments, just to reduce the load, searching for records less than 50 days old. Although the records returned are the same, strange.