Performance Issues in Recomputing logic | Community
Skip to main content
Level 2
August 26, 2020
Solved

Performance Issues in Recomputing logic

  • August 26, 2020
  • 2 replies
  • 2517 views

Hi,

For recomputing, we are using logic that works on entire nms:delivery schema. We came across following solution across the community but it doesn't seem to fix our problem either since the logic is similar and performing on entire nms:delivery schema,


<queryDef schema="nms:delivery" operation="select">

<select>

<node expr="@internalName"/>

<node expr="@id"/>

</select>

</queryDef> );

var res = query.ExecuteQuery();
var count = 0;
for each(var delivery in res.delivery){
var dId = delivery.@id;
//step 2: recompute statistics and tracking
var nmsDeliveryDirtyFlags_tracking = 1; // tracking logs
var nmsDeliveryDirtyFlags_messageCounters = 8; // broad logs
var flags = nmsDeliveryDirtyFlags_tracking | nmsDeliveryDirtyFlags_messageCounters;
NLWS.nmsDelivery.RecomputeStats(dId, flags);


This logic works, the only issue now is that the work-flow is pulling all deliveries from the Broadlog to check against and it’s causing performance issues given the amount of total deliveries. Can someone suggest what modifications could be done to this logic to only check for the delivery IDs that are imported and not all of them?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DavidKangni

Hi,

state = 95 is delivery status. for the loop query, search through the forum you should find some example. we cannot just build the query as is on the fly.

You need a process like mid sourcing and tracking process to update your logs.

 

Thanks,

David

2 replies

Level 2
August 26, 2020
Anyone around?
Milan_Vucetic
Level 9
August 26, 2020

Hi @rohanpat-1,

this query is realy "hard" and make recompute for each delivery ever sent. Not sure why you use this, as AC will do it  (not in realtime of course).
Tracking tables have link to the delivery table and this is a way to fetch impacted Delivery ID.
One way can be to use Incremental query to fetch all tracking logs since last execution of the workflow. Based on previously mentioned link, use distinct delivery IDs from result and pass it to your JS script (adapt script to read temp query table instead of nms:delivery)
Take care of temporary table behind Incremental query as can grow fast.

Regards,

Milan

DavidKangni
Community Advisor
DavidKangniCommunity AdvisorAccepted solution
Community Advisor
August 27, 2020

Hi,

state = 95 is delivery status. for the loop query, search through the forum you should find some example. we cannot just build the query as is on the fly.

You need a process like mid sourcing and tracking process to update your logs.

 

Thanks,

David

David Kangni