{"id":1178,"date":"2006-07-31T22:32:59","date_gmt":"2006-08-01T01:32:59","guid":{"rendered":"http:\/\/www.hoogervorst.ca\/arthur\/?p=1178"},"modified":"2006-07-31T22:33:27","modified_gmt":"2006-08-01T01:33:27","slug":"databases","status":"publish","type":"post","link":"http:\/\/www.hoogervorst.ca\/arthur\/?p=1178","title":{"rendered":"Databases"},"content":{"rendered":"<p><span class=\"dropcap\">I<\/span> updated the <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?page_id=1175\">plug-in<\/a> accordingly but want to issue a warning before you download it: I&#8217;m not sure <em>which<\/em> version of MySQL does or does not support &#8216;left outer joins&#8217;. I think versions > 3.23 should be able to do so. If not, you&#8217;re out of luck.\n<\/p>\n<p>(I discussed outer joins <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?p=1177#comments\">here<\/a> and <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?s=left+outer+join&#038;searchsubmit=Go\">here<\/a>)\n<\/p>\n<p>I am surprised (once again) about the database design in WordPress. Version 2.0 included &#8216;major changes&#8217;, like adding the comment count in the Posts table. If correctly designed (as in true &#8216;one-to-many&#8217; relationship), you can just fish out the comment count using an outer join without any performance loss (after all, one-to-many relationships <em>depend<\/em> on identical keys in both tables, which are generally <em>indexed<\/em> anyways!). Here&#8217;s a reminder for people who start to look around the corner, or who are just dipping their toes in SQL: you do not treat a one-to-many relationship as a &#8216;one-to-one&#8217; relationship. Trust me: you&#8217;ll miss out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I updated the plug-in accordingly but want to issue a warning before you download it: I&#8217;m not sure which version of MySQL does or does not support &#8216;left outer joins&#8217;. I think versions > 3.23 should be able to do &hellip; <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?p=1178\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[15,16],"tags":[],"_links":{"self":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/1178"}],"collection":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1178"}],"version-history":[{"count":0,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/1178\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1178"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}