{"id":1286,"date":"2020-02-24T11:44:47","date_gmt":"2020-02-24T11:44:47","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/maintenance\/retrievethencheck\/"},"modified":"2020-07-08T14:35:30","modified_gmt":"2020-07-08T14:35:30","slug":"retrievethencheck","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/retrievethencheck","title":{"rendered":"Checking for empty on associations should be done without retrieving"},"content":{"rendered":"\n<p>Instead of retrieving first then checking for empty it is more efficient to first check for empty then retrieve.<\/p>\n\n\n\n<p>Excessive retrieves can reduce performance. For more information check part 6 from <a href=\"http:\/\/Instead of retrieving first then checking for empty it is more efficient to first check for empty then retrieve.  Excessive retrieves can reduce performance. For more information check part 6 from https:\/\/www.kinetechcloud.com\/kinetech\/9-tips-for-starting-w-mendix \">https:\/\/www.kinetechcloud.com\/kinetech\/9-tips-for-starting-w-mendix <\/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=\"568\" height=\"317\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-19.png\" alt=\"\" class=\"wp-image-1288\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-19.png 568w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-19-480x268.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 568px, 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=\"584\" height=\"330\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-21.png\" alt=\"\" class=\"wp-image-1291\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-21.png 584w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/02\/image-21-480x271.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 584px, 100vw\" \/><\/figure>\n","protected":false},"featured_media":0,"parent":95,"menu_order":12,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-1286","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1286"}],"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=1286"}],"version-history":[{"count":3,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1286\/revisions"}],"predecessor-version":[{"id":1292,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1286\/revisions\/1292"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/95"}],"next":[{"title":"Scheduled events should be executed with reasonable delay","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/frequentscheduledevent","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/227"}],"prev":[{"title":"Page widget microflows should only have fast actions","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/performance\/pagewidgetheavyaction","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/1262"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1286"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=1286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}