{"id":80,"date":"2008-01-07T20:13:00","date_gmt":"2008-01-08T01:13:00","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/andrew\/2008\/01\/07\/the-importance-of-bits\/"},"modified":"2008-01-07T20:13:00","modified_gmt":"2008-01-08T01:13:00","slug":"the-importance-of-bits","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/andrew\/2008\/01\/07\/the-importance-of-bits\/","title":{"rendered":"The Importance of Bits"},"content":{"rendered":"<p>With their abundant availability both in volatile and permanent storage (i.e., RAM and hard-disks), sometimes I think the value of bits is lost on more recent developers, especially those that write in a very high-level language, like, say, PHP. The past few weeks I&#8217;ve been working very closely with some data analysts in our company &#8212; in particular, I&#8217;ve been compiling some very large tables (think nearly 1 billion rows per month) into &#8220;views&#8221; (technically, they&#8217;re completely new tables) that are much more manageable.<\/p>\n<p>Tonight, mostly as an exercise in futility, I began looking at some of the foreign keys stored in the gargantuan tables. One of them in particular links to a table that currently contains (oddly enough) 256 rows. It grows very, very slowly. Currently the column is a long integer: 4 bytes. Imagine for a minute that we replaced that with what MySQL calls a small integer, or 2 bytes. Last month&#8217;s table was in the neighborhood of 900,000,000 rows, times 2, divided by 1024&#8230; That&#8217;s something just shy of 2 GIGAbytes that we&#8217;ve saved. (Never mind that there are about 4 other foreign keys this could also be applied to).<\/p>\n<p>Every byte adds up, folks. Save &#8217;em while you can.<\/p>\n<p>(Some might call this inconvenient math. I&#8217;m not quite that unscrupulous.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With their abundant availability both in volatile and permanent storage (i.e., RAM and hard-disks), sometimes I think the value of bits is lost on more recent developers, especially those that write in a very high-level language, like, say, PHP. The past few weeks I&#8217;ve been working very closely with some data analysts in our company [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,25,37],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-programming","category-rants","category-work"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}