Question
· Jan 31, 2019

Which global mapping definition is better?

Sometimes global mapping of the same globals can be defined in different ways. E.g., I need to define it for 3 globals ^qAuditC, ^qAuditLog, ^qAuditLogC from the same database named APP-NOJOURN. Which approach should be better from the performance point of view?

1) qAudit* => APP-NOJOURN (one record in global mapping table)
or

2) qAuditC => APP-NOJOURN
qAuditLog => APP-NOJOURN
qAuditLogC => APP-NOJOURN (three records in global mapping table)

From one hand, the less records in global mapping table, the better. From other hand, * can cause additional processing at run time. Global mapping table for a namespace contains about 20 records and can be compressed to 15 ones if "unduplicated" such way.

Any advice will be great appreciated.

P.S. I'm pretty sure that there would be no globals masked as qAudit* but those listed above.

Discussion (3)1
Log in or sign up to continue

Personally, I would definitely recommend using variant 1 with * . It seems to  me shorter, brighter and clearer.

I would not worry about the speed of evaluation *  (just feeling - certainly I have no numbers or proofs about performance).

If I am correct and remember well the ISC courses, the "global directory/list of global vectors" is held somewhere in memory  for each process while beeing in certain namespace. And therefore should be quickly evaluated.

Additionally, if you would need to add a new global in the future (such as qAuditS for streams), then the current definition will satisfy such need automatically and without updating the map table. However similar mapping for the different LIVE / TEST / EDU / CLONE / ... instances should always be done by scripts and automatically during the upgrade every instance.