I’ve optimized test execution reporting for several large-scale ALM deployments, and your timeout issue requires a multi-layered solution addressing all the key performance factors.
Report Timeout Configuration: First, adjust the timeout settings appropriately. In Site Administration > Server Configuration, increase report.execution.timeout=300 (5 minutes) and enable report.query.optimization=true. However, timeout adjustment is just a temporary measure - the real fix requires addressing the underlying query performance.
Database Indexing: Create a composite index that matches your query pattern exactly:
CREATE INDEX idx_test_run_progress
ON TEST_RUN_HISTORY(release_id, test_id, execution_status)
This index can be created online in most databases without downtime. The composite index covers both your WHERE clause and GROUP BY columns, enabling index-only scans that avoid full table reads. This typically reduces query time from 120+ seconds to under 10 seconds.
Parameterized Queries: Ensure your Analysis View uses proper parameterization. Modify the query to use bind variables instead of literal values:
SELECT test_id, execution_status, COUNT(*)
FROM TEST_RUN_HISTORY
WHERE release_id = :release_param
GROUP BY test_id, execution_status
Parameterized queries enable execution plan caching, which dramatically improves performance for repeated report generation.
Test Run Archiving: Implement a data lifecycle policy for TEST_RUN_HISTORY. Archive test runs older than 90 days to a separate table:
-- Pseudocode - Key archiving steps:
1. Create TEST_RUN_ARCHIVE table with identical schema
2. Move records WHERE execution_date < CURRENT_DATE - 90
3. Create scheduled job to run archiving monthly
4. Update Analysis Views to query active table only
5. Create separate historical reports for archived data
Archiving keeps your active table size manageable, which is critical for sub-second query performance even with proper indexing.
After implementing these changes, test with your largest release dataset. The combination of proper indexing, parameterized queries, appropriate timeout configuration, and data archiving will eliminate the timeout issues and make your release readiness reports run in under 15 seconds consistently, even with 10,000+ test runs.