原创 德哥的PostgreSQL私房菜 - 史上最牛皮的PG資料合集

德哥的PostgreSQL私房菜 - 史上最屌PG資料合集 轉自:https://yq.aliyun.com/articles/59251?spm=5176.100239.bloglist.95.5S5P9S 看完並理解這些文章,相信你會

原创 PostgreSQL Logical Decoding(二)pg_recvlogical工具測試

1、創建slot $ pg_recvlogical -U postgres -d postgres --slot test --create-slot 2019-04-05 13:11:35.149 CST [20380] LOG:

原创 PostgreSQL Logical Decoding(一)

測試前需要先設置2個參數: wal_level=logical,需要重啓 max_replication_slots  默認10個,夠用了,暫時不需要修改。 1、創建一個複製槽,名稱爲logical_slot,使用插件:test_deco

原创 構建一個簡單的數據庫系列(九)二分查找和重複key(未完成)

英文原文鏈接:https://cstack.github.io/db_tutorial/parts/part9.html 上次我們注意到我們仍然按照未排序的順序存儲key。我們將解決該問題,並檢測並拒絕重複的密鑰。  

原创 構建一個簡單的數據庫系列(十)葉子節點拆分(未完成)

英文原文鏈接:https://cstack.github.io/db_tutorial/parts/part10.html 我們的B-Tree還不是一個真正的B-Tree,因爲只有一個節點。爲了解決這個問題,我們需要一些代碼來實現拆分一個

原创 構建一個簡單的數據庫系列(八)引入B-tree之二

英文原文鏈接:https://cstack.github.io/db_tutorial/parts/part8.html 如何向葉子節點插入數據 這一節我們只實現一個單節點樹。回想下上節的內容,一顆樹是從一顆空的葉子節點數開始演變的。

原创 構建一個簡單的數據庫系列(八)引入B-tree

Cursor* table_end(Table* table) { Cursor* cursor = malloc(sizeof(Cursor)); cursor->table = table; - cursor->row

原创 讀《代碼的未來》有感

章節5:支持大數據的數據存儲技術 使用鍵值存儲的數據庫,大多數都在數據查找技術上使用了散列這種數據結構。散列表中的數據量無論如何增大,其查找數據所需的時間幾乎是固定不變的,因此也是一種非常合適大規模數據的技術。   一、數據庫的ACID特

原创 構建一個簡單的數據庫系列(七)引入B-tree(未完成)

英文鏈接:https://cstack.github.io/db_tutorial/parts/part7.html

原创 構建一個簡單的數據庫系列(六)cursor抽象(未完成)

英文連接:https://cstack.github.io/db_tutorial/parts/part6.html 爲了實現B-tree,這一節先對當前的實現進行一點重構。 我們增加一個概念:Cursor(遊標),代表了對象在數據庫中的

原创 構建一個簡單的數據庫系列(五)持久化到硬盤

英文鏈接:https://cstack.github.io/db_tutorial/parts/part5.html “Nothing in the world can take the place of persistence.” – 

原创 構建一個簡單的數據庫系列(三)駐在內存append only的單表數據庫

英文鏈接:https://cstack.github.io/db_tutorial/parts/part3.html 假設表定義如下: column type id integer username varchar(32) email v

原创 構建一個簡單的數據庫系列(四)測試用例(未完)

英文鏈接:https://cstack.github.io/db_tutorial/parts/part4.html 這一節主要對第三節大代碼進行詳細的測試 這裏使用rspec工具進行測試用例編寫。http://rspec.info/

原创 構建一個簡單的數據庫系列(一)創建一個REPL

原文鏈接:https://cstack.github.io/db_tutorial/parts/part1.html sqlite3框架 Code Generator以上歸入到前端,以下歸入到後端。 第1節的目標,實現一個簡單的交互式解

原创 構建一個簡單的數據庫系列(二)世界上最簡單的sql解析器和虛擬機

英文原鏈接:https://cstack.github.io/db_tutorial/parts/part2.html The “front-end” of sqlite is a SQL compiler that parses a