Document control version history export times out when generating audit reports

Our document-control module has over 12,000 controlled documents with extensive version histories. When we attempt to export version history for audit reports through the compliance-auditing module, the export consistently times out after about 45 minutes. The export progress bar reaches approximately 60% before the timeout error appears.

We’ve checked the timeout configuration in the system settings and it’s set to 3600 seconds (1 hour). Increasing this further seems like a band-aid solution. I suspect we need to look at batch processing settings or database indexing for the version history queries.

Our auditors need these reports by end of month. Has anyone successfully optimized large-scale version history exports in mc-2022.2?

Check if your DOCUMENT_VERSIONS table has proper indexes. Run EXPLAIN PLAN on your version history query-I bet it’s doing full table scans. You need composite indexes on (document_id, version_number, effective_date) at minimum.

The batch processing configuration is probably your bottleneck. Document control exports in mc-2022.2 default to processing 500 records per batch, which is way too small for 12K documents. Look in mastercontrol-export.properties for the batch size setting:


export.batch.size=500
export.batch.commit.interval=100

Try increasing batch size to 2000 and commit interval to 500. Also check your database connection pool has enough connections allocated for long-running export operations.

Here’s the complete optimization approach that should resolve your timeout issues:

1. Database Indexing (Critical) Have your DBA create these indexes on the document version history tables:

CREATE INDEX idx_doc_versions_composite ON document_versions(document_id, version_number, effective_date);
CREATE INDEX idx_doc_versions_audit ON document_versions(audit_trail_id, created_date);

These indexes dramatically speed up version history queries, especially when joining with audit trail data.

2. Batch Processing Configuration Update your mastercontrol-export.properties file:


export.batch.size=2000
export.batch.commit.interval=500
export.batch.timeout=7200

The key is matching commit interval to half your batch size and giving individual batches enough timeout headroom.

3. Pagination Settings In the same properties file, align pagination with batch processing:


export.pagination.maxResults=2500
export.pagination.fetchSize=1000

This ensures queries fetch enough data per round-trip without overwhelming memory.

4. Timeout Configuration Strategy Instead of just increasing the global timeout, use tiered timeouts:

  • Query timeout: 1800 seconds (30 min)
  • Batch timeout: 7200 seconds (2 hours)
  • Overall export timeout: 10800 seconds (3 hours)

This prevents individual slow queries from blocking the entire export while giving the full process enough time.

5. Enable Streaming Mode In Admin Console > Document Control > Export Settings, enable “Stream Export Results”. This allows the compliance-auditing module to start building reports while the export is still running, rather than waiting for completion.

6. Monitor and Validate After applying these changes, test with a subset first (e.g., 3000 documents). Monitor the database during export to confirm indexes are being used. Check the export logs for batch processing metrics-you should see consistent batch completion times around 2-3 minutes per batch.

The combination of proper indexing, optimized batch processing, and aligned pagination settings should get your 12K document export completing in under 90 minutes. The streaming mode ensures audit reports start generating immediately, further reducing perceived wait time.

Yes, pagination is critical for large exports. The export module uses pagination to chunk the query results, but the default page size might be too aggressive. Check export.pagination.maxResults in your configuration-it should be aligned with your batch size. If batch size is 2000, set pagination to 2000 or slightly higher like 2500 to avoid unnecessary query round-trips.