Hi Martin,
Check out this learning path: https://academy.mendix.com/link/path/62/Constrain-Your-Data-Using-XPath. I’m sure you will find it insightful and it is sure to answer your questions.
This method works, in my experience. Logically, the more rows in your table, the greater gains you will see.
Hi Martin,
If you have some knowledge regarding queries and their performance (I don’t have a lot of knowledge on this topic), then it might help you to look at the actual queries.
I rebuilt your testcase in my project, looking at the queries of your two scenarios it shows that they are really different.
First scenario (one query):
'SELECT Test.Main/* FROM Test.Main WHERE Test.Main.ID IN (SELECT x1Test.Main.ID FROM Test.Main AS x1Test.Main WHERE (x1Test.Main.ID IN (SELECT x2Test.Main.ID FROM Test.Main AS x2Test.Main WHERE x2Test.Main.ID = x1Test.Main.ID AND x2Test.Main/Test.Main_Associated1 = 27021597764222977) OR x1Test.Main.ID IN (SELECT x3Test.Main.ID FROM Test.Main AS x3Test.Main WHERE x3Test.Main.ID = x1Test.Main.ID AND x3Test.Main/Test.Main_Associated2 = 27303072740933633)))'
Second scenario (two queries):
'SELECT Test.Main/* FROM Test.Main WHERE Test.Main.ID IN (SELECT x1Test.Main.ID FROM Test.Main AS x1Test.Main WHERE x1Test.Main/Test.Main_Associated1 = 27021597764222977)'
'SELECT Test.Main/* FROM Test.Main WHERE Test.Main.ID IN (SELECT x1Test.Main.ID FROM Test.Main AS x1Test.Main WHERE x1Test.Main/Test.Main_Associated2 = 27303072740933633)'
I’m hoping that this is of any help.
Kind regards,
Joost