{"id":2758,"date":"2023-10-17T19:23:53","date_gmt":"2023-10-17T11:23:53","guid":{"rendered":"https:\/\/white-night.club\/?p=2758"},"modified":"2023-11-09T11:07:48","modified_gmt":"2023-11-09T03:07:48","slug":"pg12","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/17\/pg12\/","title":{"rendered":"MIT6.5830 Lab1-GoDB\u5b9e\u9a8c\u8bb0\u5f55\uff08\u4e00\uff09"},"content":{"rendered":"\n<p>\u4e86\u89e3\u63a5\u4e0b\u6765\u7684\u5b9e\u9a8c\u8981\u505a\u4ec0\u4e48\u3002<\/p>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u5b9e\u9a8c\u76ee\u7684<\/p>\n<cite><em>\u5b9e\u73b0GoDB<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u4ecelab1\u5f00\u59cb\u4e00\u76f4\u5230\u5b9e\u9a8c\u7ed3\u675f\uff0c\u6211\u4eec\u7684\u76ee\u7684\u53ea\u6709\u4e00\u4e2a&#8211;\u5b9e\u73b0GoDB\uff0c\u4e00\u4e2a\u57fa\u7840\u7684\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u800c\u672c\u6b21\u5b9e\u9a8clab1\u4e3b\u8981\u5b8c\u6210\u7684\u529f\u80fd\u4e3a\uff1a\u8bbf\u95ee\u78c1\u76d8\u4e0a\u5b58\u50a8\u7684\u6570\u636e\u3002\u8fd9\u70b9\u6211\u4eec\u4f1a\u5728\u63a5\u4e0b\u6765\u7684\u5b9e\u9a8c\u8bb0\u5f55\u4e2d\u6162\u6162\u5c55\u5f00\u3002<\/p>\n\n\n\n<p>\u7531\u4e8e\u6211\u662f\u8fb9\u505a\u5b9e\u9a8c\u8fb9\u8bb0\u5f55\uff0c\u6240\u4ee5\u53ef\u80fd\u5728\u8bb0\u5f55\u8fc7\u7a0b\u4e2d\u6709\u4e9b\u9057\u6f0f\u7684\u5730\u65b9\u6ca1\u6709\u8bb2\u5230\uff0c\u4e0d\u8fc7\u6211\u8fd8\u662f\u4f1a\u5c3d\u529b\u7ed9\u51fa\u4e00\u4e2a\u8be6\u7ec6\u5177\u4f53\u7684\u601d\u8def\u7684\uff0c\u8fd8\u8bf7\u89c1\u8c05\ud83d\ude22\u3002<\/p>\n\n\n\n<p>\u4e0d\u8fc7\u5728\u5f00\u59cb\u9605\u8bfb\u672c\u6b21\u5b9e\u9a8c\u8bb0\u5f55\u4e4b\u524d\uff0c\u4f60\u5e94\u8be5\u9605\u8bfb\u5148\u4e86\u89e3\u4ee5\u4e0b\u6587\u7ae0\uff1a<\/p>\n\n\n\n<ul>\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/white-night.club\/index.php\/2023\/10\/17\/db7\/\" target=\"_blank\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0086ff\" class=\"has-inline-color\">\u6570\u636e\u5e93\u7cfb\u7edf\uff1a\u521d\u8bc6\u5b58\u50a8\u7ba1\u7406\u5668<\/mark><\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/white-night.club\/index.php\/2023\/10\/17\/db8\/\" target=\"_blank\" rel=\"noreferrer noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0086ff\" class=\"has-inline-color\">\u5173\u7cfb\u6570\u636e\u5e93\u7684\u7ed3\u6784<\/mark><\/a><\/li>\n<\/ul>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u5b9e\u9a8c\u6b65\u9aa4<\/p>\n<cite><em>\u9605\u8bfblab1\u5b9e\u9a8c\u8981\u6c42<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u5148\u6765\u770b\u770bGoDB\u7684\u67b6\u6784<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GoDB consists of:\n\nStructures that represent fields, tuples, and tuple schemas;\nMethods that apply predicates and conditions to tuples;\nOne or more access methods (e.g., heap files) that store relations on disk and provide a way to iterate through tuples of those relations;\nA collection of operator classes (e.g., select, join, insert, delete, etc.) that process tuples;\nA buffer pool that caches active tuples and pages in memory and handles concurrency control and transactions (neither of which you need to worry about for this lab); and,\nA catalog that stores information about available tables and their schemas.<\/code><\/pre>\n\n\n\n<p>\u9996\u5148\uff0cGoDB\u5305\u62ec<\/p>\n\n\n\n<ul>\n<li>\u8868\u793a\u4e86\u5b57\u6bb5\uff0c\u5143\u7ec4\u548c\u5143\u7ec4\u6a21\u5f0f\uff08\u7528\u4e8e\u63cf\u8ff0\u5143\u7ec4\u4e2d\u5404\u6570\u636e\u7684\u6570\u636e\u7c7b\u578b\u548c\u7ed3\u6784\uff09\u7684\u6570\u636e\u7ed3\u6784\uff1b<\/li>\n\n\n\n<li>\u901a\u8fc7\u6761\u4ef6\u548c\u8c13\u8bcd\u7b5b\u9009\u5143\u7ec4\u6570\u636e\u7684\u65b9\u6cd5\uff1b<\/li>\n\n\n\n<li>\u5c06\u6570\u636e\u5b58\u50a8\u5728\u78c1\u76d8\u4e0a\uff0c\u5e76\u63d0\u4f9b\u67d0\u4e2a\u65b9\u5f0f\u4ee5\u904d\u5386\u5173\u7cfb\u4e2d\u7684\u5143\u7ec4\uff1b<\/li>\n\n\n\n<li>\u5b9e\u73b0\u50cfSELECT\uff0cDELETE\u8fd9\u4e9b\u6307\u4ee4\u7684\u6307\u4ee4\u96c6\uff1b<\/li>\n\n\n\n<li>\u5904\u7406\u5e76\u53d1\u63a7\u5236\u548c\u4e8b\u52a1\uff0c\u4ee5\u53ca\u7f13\u5b58\u6570\u636e\u81f3\u5185\u5b58\u7684\u7f13\u51b2\u533a\uff08\u672c\u6b21\u5b9e\u9a8c\u4e0d\u7528\u7ba1\u5b83\uff0c\u8c8c\u4f3c\u5df2\u7ecf\u5b9e\u73b0\u4e86\uff09\uff1b<\/li>\n\n\n\n<li>\u6700\u540e\u5219\u662f\u76ee\u5f55\uff0c\u7528\u4e8e\u5b58\u50a8\u8868\u548c\u5b83\u4eec\u5bf9\u5e94\u6a21\u5f0f\u7684\u4fe1\u606f\u3002<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full has-custom-border\"><img loading=\"lazy\" decoding=\"async\" width=\"860\" height=\"305\" src=\"https:\/\/white-night.club\/wp-content\/uploads\/2023\/10\/f20a2c9f3da62e11d04e077d033cc36.png\" alt=\"\" class=\"wp-image-2795\" style=\"border-style:none;border-width:0px;border-radius:0px\" srcset=\"https:\/\/white-night.club\/wp-content\/uploads\/2023\/10\/f20a2c9f3da62e11d04e077d033cc36.png 860w, https:\/\/white-night.club\/wp-content\/uploads\/2023\/10\/f20a2c9f3da62e11d04e077d033cc36-300x106.png 300w, https:\/\/white-night.club\/wp-content\/uploads\/2023\/10\/f20a2c9f3da62e11d04e077d033cc36-768x272.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/figure>\n\n\n\n<p>\u4e4b\u540e\u9605\u8bfb\u6574\u4e2alab1\u7684markdown\u6587\u6863\uff0c\u53ef\u4ee5\u770b\u5230\u8fd9\u6b21\u5b9e\u9a8c\u5171\u67095\u4e2a\u6a21\u5757\u3002\u6211\u4eec\u5c06\u4f9d\u6b21\u6765\u5b8c\u6210\u5b83\u4eec\u3002<\/p>\n\n\n\n<p>\u4f46\u5728\u6b64\u4e4b\u524d\u8bf7\u5728go.sum\u6240\u5728\u76ee\u5f55\u7684\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff0c\u5426\u5219go test\u7684\u65f6\u5019\u4f1a\u62a5\u9519\u201c\u7f3a\u5c11\u4f9d\u8d56\u9879\u201d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>go get github.com\/srmadden\/godb\ngo get main<\/code><\/pre>\n\n\n\n<p>\u4ee5\u53ca\u5728agg_op\u4e2d\u6709\u4e00\u4e2a\u672a\u4f7f\u7528\u7684\u53d8\u91cf\uff0c\u7528\u7a7a\u767d\u7b26\u5373\u53ef\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full has-custom-border\"><img loading=\"lazy\" decoding=\"async\" width=\"696\" height=\"531\" src=\"https:\/\/white-night.club\/wp-content\/uploads\/2023\/10\/166fe0105687cbc3c7ba8028c3e7b64.png\" alt=\"\" class=\"wp-image-3039\" style=\"border-style:none;border-width:0px;border-radius:0px\" srcset=\"https:\/\/white-night.club\/wp-content\/uploads\/2023\/10\/166fe0105687cbc3c7ba8028c3e7b64.png 696w, https:\/\/white-night.club\/wp-content\/uploads\/2023\/10\/166fe0105687cbc3c7ba8028c3e7b64-300x229.png 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/figure>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lab1\u5b9e\u9a8c\u8bb0\u5f55\uff1a\u5b9e\u73b0GoDB<\/p>\n","protected":false},"author":1,"featured_media":2795,"comment_status":"open","ping_status":"closed","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[44,33],"tags":[34,80],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2758"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=2758"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2758\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2795"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=2758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}