MySQL InnoDB 與 PostgreSQL 的 Partial Index(es) 是不一樣的東西...

MySQL InnoDB 指的 Partial Index 是:

An index that represents only part of a column value, typically the first N characters (the prefix) of a long VARCHAR value.

PostgreSQL 指的 Partial Indexes 是:

A partial index is an index built over a subset of a table; the subset is defined by a conditional expression (called the predicate of the partial index). The index contains entries only for those table rows that satisfy the predicate. Partial indexes are a specialized feature, but there are several situations in which they are useful.

先講結論,PostgreSQL 可以做掉 MySQL InnoDB 的 Partial Index 想做的事情,而且還更多。

MySQL InnoDB 的 Partial Index 是設定對 prefix index (對字串前面的 n bytes),可能的情況是 CHAR(32) 只對前面 16 bytes 索引。

PostgreSQL 的 Partial Indexes 受益於許多方面而更強大。因為有 Indexes on Expressions,所以除了可以像 MySQL 對 prefix 索引外,也可以索引 suffix,甚至是索引透過 string function 得出來的值。

像是 PostgreSQL 可以設定「我只要索引一月一日出生的人的 username」:

CREATE INDEX test_index ON test_table (username) WHERE birth_month = 1 AND birth_day = 1;

在 MySQL 裡需要反正規化後下 index,或是拆出另外一個表格再下 index 的問題,在善用 PostgreSQL 這些功能就可以省下不少功夫...

判斷資料庫是否可以轉移到 Galera Cluster 上的方式...

Open Query 的人給了一個很簡單的方式,只要下一個 SQL query 去查就可以知道有哪些 table 不符合 Galera Cluster 的條件:「Galera pre-deployment check」。

就目前看到的說明以及 SQL query 算是 pre-check:回報 okay 不代表上了就沒問題,但如果有回報有問題,表示上了 Galera Cluster 後會遇到問題。

這個檢查適用於 MySQL 以及目前常見的 MySQL fork (像是 MariaDBPercona Server)。

SkySQL 與 Monty Program Ab 合併...

TechCrunch 上看到這兩家合併的消息:「SkySQL Merges With MariaDB Creator Monty Program To Solidify Its Open Source Database Position」。

SkySQL 頭接任 CEO,原 Monty Program Ab 頭接任 CTO。對 SkySQL 沒什麼好印象,這合併是要幹什麼...

MariaDB 10.0.1...

MariaDB 發表 MariaDB 10.0.1 了:「What does MariaDB 10.0.1 include – available now」。

公告的文章把一些資訊整理出來讓大家與 MySQL 5.6 比較... XD

  • MariaDB 10.0-only Features:只有 MariaDB 10.0 有的功能。
  • MariaDB 10.0 Merged Features:從 MySQL 5.6 拉回來的功能。
  • MariaDB 10.0 Reimplemented Features:兩邊都有的功能,不過 MariaDB 自己重新實作了 (重寫)。
  • MariaDB 5.x Features now in MySQL 5.6:MySQL 5.6 從 MariaDB 5.x 拉的功能
  • MariaDB 5.x Features Backported from MySQL 5.6:MariaDB 5.x 從 MySQL 5.6 拉出來的功能。

然後沒有列出 MySQL 5.6 有,但是 MariaDB 沒有的功能... XD

先不管這些東西,10.0.1 多了 Cassandra storage engine 看起來就很有趣啊,可以透過 MySQL server 當 Cassandra client 跑去 Cassandra Cluster 讀寫資料:

看說明是透過 CQL 要資料,所以仍然是受限於 CQL 的能力。