Performance and Scaling¶
Focus Areas¶
Narrow scope where practical (ObjID lists, date windows).
Reuse ProcessBatch context for traceability.
Maintain supporting indexes on frequently filtered columns (Process_ID, LastModified, Workflow_State).
Avoid unnecessary full-table scans in recurring jobs.
Index Considerations¶
Suggested nonclustered index pattern (evaluate fragmentation vs. benefit):
CREATE NONCLUSTERED INDEX IX_<ClassTable>_Process_LastModified
ON dbo.MFCustomer (Process_ID, LastModified);
Large Tables and First Loads¶
For a class with more than about 10,000 records, and for every first load of a class table against a large vault, use spMFUpdateTableinBatches instead of a single spMFUpdateTable run. It updates the table in bulk, in batches of 500, so each transfer stays small, a failure only affects the batch in progress, and progress is visible.
EXEC dbo.spMFUpdateTableinBatches @MFTableName = 'MFCustomer',
@UpdateMethod = 1, -- M-Files to SQL
@WithTableAudit = 1, -- refresh the table audit first
@FromObjid = 1,
@ToObjid = 60000, -- highest object ID + 500
@WithStats = 1;
See Update large tables in bulk using batch mode for how to choose the range, load a class table that is still empty, restart after a stop and read the progress messages, and using spmfupdatetableInbatches for batch updates for a worked example.
Large Volume Updates¶
Partition large batches (spMFUpdateTable_ObjIDs_Grouped).
Stage candidate keys into a temp table, join back for marking Process_ID.
Measure round-trip latency to M-Files; avoid oversaturating vault operations.
Concurrency¶
Run metadata sync (structure) separate from heavy update cycles to avoid locks during DDL adjustments.
Monitoring¶
Use: - spMFProcessBatch_Upsert - spMFGetMfilesLog - spMFTableAudit
Example:
EXEC dbo.spMFGetMfilesLog
@Top = 200,
@OrderDescending = 1;