Idea ID: 1766517

Implement performance improvement for ScriptLibrary "context"

Status : Delivered
over 2 years ago

Selecting only specified fields of a dbdict can speed up performance significantly - especially when a dbdict is mapped to multiple tables like dbdict cm3r, probsummary, rootcause, etc.

The ScriptLibrary "context" is used to select information from related record in other modules - i.e for related interactions to incidents, or parent changes to change tasks, etc. - so exactly this kind of dbdicts that can benefit most of such a performance improvement.

Example function in SL context to be improved:


function GetValue(name, tablename, field, returnfield)
{
var fRecord = new SCFile(tablename);
var sql = field + "= \"" + name + "\"";
fRecord.doSelect( sql );
return fRecord[returnfield];

}

 

Suggested implementation:

 

function GetValue(name, tablename, field, returnfield)
{
var fRecord = new SCFile(tablename, SCFILE_READONLY);

fRecord.setFields( [ returnfield ] );
var sql = field + "= \"" + name + "\"";
fRecord.doSelect( sql );
return fRecord[returnfield];

}