Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

TestRail DB: Case table data grows on every time we close test plan


Recently we noticed executing any query on case table takes more than usual time. When we looked at the data, it looks like case table have millions of records against actual valid cases (It happens when ever we close our test plan, it logs underlying cases ).

–Total record/valid cases -:4973396/45150

By looking at the above number, we are little worried as once team start closing their plans, it might impact the UI as well. Please suggest how this can be handled to avoid any future impact?


We are having the same problem. I did some investigation of the database and discovered that TestRail creates a test in the tests table for every test case when creating a test run. I added 1 test case to a test run and the table was populated with all the test cases.

I also found that when I close a run, TestRail makes a copy of the content for every test case in the cases table.

Our performance continues to degrade, especially when we close a test run. We only have 13 thousand test cases, but there are over 17 million records both the cases and tests tables.

Is this a known bug? This can’t be working as designed.


Did either of you make any progress on these performance / database growth issues ?


It actually is… Runs are copies of the test cases so that they are separate from each other and when closed a copy is made to keep the history with the run. Original test cases are the repository and never have a history since the same case could be run 100’s if not thousands of times in a year for many large corps. History and auditing would be a massive mess.


Hi All,

BGanger is correct, this is by design actually so that completed runs are archived and can be used for auditing purposes. Completed runs are also immutable which means that changes to the referenced test cases or test suite do not propagate to the completed/closed test run (e.g. if you delete a test case in the test suite of the run, the related test and its test results are still available for a completed test run).

This means there is potential for the database to grow rapidly. While I can’t provide specific names, there are teams operating comfortably at the scale of tens of thousand of test cases and millions of records.

We have a general performance optimization guide on our website here you may find help in improving your current setup :

It is also a good idea to ensuring that your database is hosted on the best IOPS performing storage available. For example using SSD storage will provide far superior performance over spinning disks.