cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Relation Query very Slow

cbelka
Participant
1,263

The Query

SELECT PK,TargetPK,SourcePK,SequenceNumber,RSequenceNumber FROM pgrels WHERE SourcePK IN (?) AND languagepk IS NULL  UNION SELECT PK,TargetPK,SourcePK,SequenceNumber,RSequenceNumber FROM pgrels WHERE TargetPK IN (?) AND languagepk IS NULL


during guestcheckout is getting very very slow because it gets nearly the whole customer database when adding the customer to the customergroup during checkout.

It gets generated from the "ModifyManyToManyRelationStatementsBuilder" ... I remebered that from old versions the flag "relation.PrincipalGroupRelation.markmodified" did help there but I might be wrong ... can anyone help here ?

SAP Commerce 1811 is our version

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Christian - How do we implement your suggestion of "use legacy mode not globally but for saving this single transaction" ?

Thanks in advance for your help.

0 Likes

Hello cssidhu, We are facing the same issue in v2005. Any suggestions please?

cbelka
Participant
0 Likes

yeah you can use legacy mode not globally but for saving this single transaction ... There is a Util for that , with legacy mode you dont have this problem

0 Likes

Hello cbelka, We are facing the same issue in v2005. Could you please explain which legacy mode u r talking about for the transaction?

cbelka
Participant
0 Likes

Yes as I mentioned, identify the query (update etc) and then run it in legacy mode

PersistenceUtils.doWithLegacyPersistence(() -> {
    doSlowStuff(modelWithLotsOfRelations);
    modelService.save(modelWithLotsOfRelations);
    return null;
});

pavan_joshi1
Participant
0 Likes

Oh.. Interesting! I want to try this sometime.