{"id":1221,"date":"2020-02-17T07:57:06","date_gmt":"2020-02-17T07:57:06","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/performance\/notorxpath\/"},"modified":"2020-07-08T14:35:30","modified_gmt":"2020-07-08T14:35:30","slug":"notorxpath","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/notorxpath","title":{"rendered":"Not\/or expressions in XPath should be avoided when the path goes over an association"},"content":{"rendered":"\n<p>Introduced in version 1.6 (21 February 2020)<\/p>\n\n\n\n<p>This is a known performance issue. If possible replace it with separate simple retrieves and list operations.<\/p>\n\n\n\n<p>For more information check the <a href=\"https:\/\/docs.mendix.com\/howto\/general\/dev-best-practices#4-4-xpath\">Mendix best practices for XPath performance<\/a> or this <a href=\"https:\/\/www.youtube.com\/watch?time_continue=1819&amp;v=xNR3BjJYt3U\">excellent webinar<\/a>.<\/p>\n\n\n\n<p><strong>Non-compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"573\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-6-1024x573.png\" alt=\"\" class=\"wp-image-1228\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-6-980x549.png 980w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-6-480x269.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p><strong>Compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"569\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-7-1024x569.png\" alt=\"\" class=\"wp-image-1230\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-7-980x545.png 980w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-7-480x267.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n","protected":false},"featured_media":0,"parent":95,"menu_order":21,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-1221","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1221"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1221"}],"version-history":[{"count":3,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1221\/revisions"}],"predecessor-version":[{"id":1231,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1221\/revisions\/1231"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/95"}],"next":[{"title":"Only short actions should be used in a loop","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/loopheavyaction","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1147"}],"prev":[{"title":"Microflows should perform database actions at the end","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/commitatend","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/761"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1221"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=1221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}