2024/08/17

MonetDB

MonetDB is an open-source column-oriented relational database management system (RDBMS) originally developed at the Centrum Wiskunde & Informatica (CWI) in the Netherlands. It is designed to provide high performance on complex queries against large databases, such as combining tables with hundreds of columns and millions of rows.

MonetDB architecture is represented in three layers, each with its own set of optimizers. The front end is the top layer, providing query interface for SQL. Queries are parsed into domain-specific representations, like relational algebra for SQL, and optimized. The generated logical execution plans are then translated into MonetDB Assembly Language (MAL) instructions, which are passed to the next layer. The middle or back-end layer provides a number of cost-based optimizers for the MAL. The bottom layer is the database kernel, which provides access to the data stored in Binary Association Tables (BATs). Each BAT is a table consisting of an Object-identifier and value columns, representing a single column in the database.

MonetDB internal data representation also relies on the memory addressing ranges of contemporary CPUs using demand paging of memory mapped files, and thus departing from traditional DBMS designs involving complex management of large data stores in limited memory.


使用 RPM 安裝以後,使用下列的方式開啟資料庫服務:

sudo systemctl start monetdbd.service

使用下列的方式查詢目前的狀態:

sudo systemctl status monetdbd.service

使用下列的方式停止服務:

sudo systemctl stop monetdbd.service

下面建立一個 demo 資料庫。

sudo monetdb create demo

還需要 release 才能夠使用:

sudo monetdb release demo

然後就可以使用 mclient 連線進行測試:

mclient -u monetdb -d demo

一般而言可以將 user/password 記錄在 .monetdb 中,這樣就不需要輸入帳號密碼,只需要提供資料庫名稱。 下面是內容設定的例子:

user=monetdb
password=monetdb

如果想要刪除資料庫,可以使用 stop 與 destroy:

sudo monetdb stop demo
sudo monetdb destroy demo

使用下列的指令建立一個使用者 danilo:

CREATE USER "danilo" WITH PASSWORD 'danilo' NAME 'Danilo' SCHEMA "sys";
CREATE SCHEMA "danilo" AUTHORIZATION "danilo";
ALTER USER "danilo" SET SCHEMA "danilo";

使用 mclient 連線驗證:

mclient -u danilo demo

MonetDB/e Embedded

MonetDB/e is the embedded version of MonetDB, embed the power of an analytical SQL database engine in your Python or C/C++ applications.

相關連結

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。