{"id":44126,"date":"2021-10-07T19:27:46","date_gmt":"2021-10-07T19:27:46","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=44126"},"modified":"2021-10-07T19:27:46","modified_gmt":"2021-10-07T19:27:46","slug":"answer-by-warren-for-where-vs-sort-which-is-more-efficient","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=44126","title":{"rendered":"Answer by warren for where vs sort: Which is more efficient?"},"content":{"rendered":"<p>The &quot;correct&quot; answer is the one @RichG <a href=\"https:\/\/stackoverflow.com\/a\/69486596\/4418\">gave<\/a><\/p>\n<p>However, as with most things in life, the &quot;reality&quot; answer is &quot;it depends&quot;<\/p>\n<p>It <em>should<\/em> be the case that filtering before sorting will be more efficient<\/p>\n<p>But I have seen instances where filtering <em>later<\/em> is actually more efficient (depends on a host of factors) &#8211; so you really need to try it both ways to be sure<\/p>\n<p>Docs.Splunk links:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/where\" rel=\"nofollow noreferrer\">where<\/a><\/li>\n<li><a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/sort\" rel=\"nofollow noreferrer\">sort<\/a><\/li>\n<\/ul>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/69485944\/where-vs-sort-which-is-more-efficient\/69486756#69486756<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The &quot;correct&quot; answer is the one @RichG gave However, as with most things in life, the &quot;reality&quot; answer is &quot;it depends&quot; It should be the case that filtering before sorting will be more efficient But I have seen instances where filtering later is actually more efficient (depends on a host of factors) &#8211; so you &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=44126\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for where vs sort: Which is more efficient?<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[991],"keyring_services":[],"class_list":["post-44126","post","type-post","status-publish","format-standard","hentry","category-blih","tag-stackexchange"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/44126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44126"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/44126\/revisions"}],"predecessor-version":[{"id":44127,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/44126\/revisions\/44127"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44126"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=44126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}