{"id":170,"date":"2019-08-14T15:44:43","date_gmt":"2019-08-14T15:44:43","guid":{"rendered":"http:\/\/redmine\/wordpress\/?page_id=170"},"modified":"2022-07-29T12:29:02","modified_gmt":"2022-07-29T12:29:02","slug":"optimering-af-sql","status":"publish","type":"page","link":"https:\/\/www.berg-consult.dk\/en\/optimering-af-sql","title":{"rendered":"SQL Optimization"},"content":{"rendered":"<div id=\"wp-block-themeisle-blocks-advanced-columns-369b3ec3\" class=\"wp-block-themeisle-blocks-advanced-columns has-2-columns has-desktop-equal-layout has-tablet-equal-layout has-mobile-collapsedRows-layout has-vertical-unset\"><div class=\"wp-block-themeisle-blocks-advanced-columns-overlay\"><\/div><div class=\"innerblocks-wrap\">\n<div id=\"wp-block-themeisle-blocks-advanced-column-567809da\" class=\"wp-block-themeisle-blocks-advanced-column\">\n<p>Optimizing a SQL can require the use of several diciplines.<\/p>\n\n\n\n<p>Formally it can be stated that optimizing a SQL in a structured manner must be done by first identifying the most significant time consumption internally in the SQL and then by corresponding corrective actions reduce the identified time consumption \u2013 no other actions will make the SQL run (significantly) faster.<\/p>\n\n\n\n<p>Summarized there can be two causes for a SQL to be too slow: Sub-optimal data structures and\/or sub-optimal execution.<\/p>\n\n\n\n<p>Sub-optimal data structures will cause excessive amounts of data being read from storage (the database) and sub-optimal execution will manifest itself by the SQL statement internally processing data, that is not part of the output.<\/p>\n\n\n\n<p>Experience shows that sub-optimal execution very often is the cause of poor performance.\nSub-optimal execution can be analyzed in a structured manner by analyzing for \u201cthrow-away\u201d. <\/p>\n\n\n\n<p>This method can provide a quantification of the internal, but wasted, work in the SQL and thus provide a foundation for describing corrective actions.\nThe method can also provide an estimate of the potential improvement.<\/p>\n<\/div>\n\n\n\n<div id=\"wp-block-themeisle-blocks-advanced-column-af2e0a32\" class=\"wp-block-themeisle-blocks-advanced-column\">\n<p>Martin Berg Consult can assists in both identifying problematic SQL\u2019s and the following optimization of the SQL.<\/p>\n\n\n\n<p>The optimization may include any index creation or rewrite of SQL.<\/p>\n<\/div>\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"class_list":["post-170","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/www.berg-consult.dk\/en\/wp-json\/wp\/v2\/pages\/170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.berg-consult.dk\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.berg-consult.dk\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.berg-consult.dk\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.berg-consult.dk\/en\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":2,"href":"https:\/\/www.berg-consult.dk\/en\/wp-json\/wp\/v2\/pages\/170\/revisions"}],"predecessor-version":[{"id":550,"href":"https:\/\/www.berg-consult.dk\/en\/wp-json\/wp\/v2\/pages\/170\/revisions\/550"}],"wp:attachment":[{"href":"https:\/\/www.berg-consult.dk\/en\/wp-json\/wp\/v2\/media?parent=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}