2008年12月22日

MySQL 5.1正式發行

經過漫長的等待,被Sun併購的MySQL終於推出5.1正式發行版。記得在上個月,手邊一個專案由於需要XML/XPath support,Oracle、MS SQL目前都有支援,但MySQL 5.0並未支援,從一些討論中得知MySQL 5.1將會支援,就相當期待這個新版本的正式發行。
昇陽指出,MySQL 5.1 提升了諸多新的大型企業等級功能,包含:支援五種水平資料分區的形式:range、hash、key、list以及composite (sub-partitioning);提供兩種新的複製選項。原始的複製僅會複製從主伺服器到子伺服器之間改變的資料(而不是實際的SQL statements);混合的複製則依據獨立的SQL運作,採用以statement為基礎或以原始資料為基礎的複製。

另外還有新的工具讓開發者和DBA能夠自動化地將資料庫伺服器上所執行的共同循環SQL任務排序;並將提供給MySQL Enterprise的進階訂戶,藉由監控查詢效能和修正錯誤的SQL程式碼,能大幅提升MySQL資料庫應用程式的速度和暖機時間。
(資料來源 ZDNet)
MySQL正式推出5.1版,這是2年前MySQL推出5.0版以後,官方建議企業可採用的第一個正式版本(Generally Available)。在5.1版中,主要增強了叢集化(Clustering)能力,包括新增資料表分割功能(Partitioning)和增強以列處理(Row-based)的副本功能等。

5.1新版增強資料庫的控管機制,例如調整了擴充架構,可以用外掛API(Plugin API)的方式,將需要的功能放入MySQL中,增加資料庫管理人員的使用彈性。並且新增事件排程功能(Event Scheduler),資料庫管理人員可以建立定期執行的SQL指令,不需另外撰寫外部程式來控制。所有資料庫的log記錄,直接儲存到資料表中,用SQL指令就能存取,比過去存log檔案的方式更便利。
(資料來源 iThome/王宏仁)

以下的資料整理自官方文件What's New in MySQL 5.1,列出在這個新版本中有加入哪些新特色,僅部份提供翻譯(只翻我自己有興趣看的部份囉)。
  • Partitioning(資料表分割). 這項功能允許將個別資料表(table)分散成多個部份儲存在檔案系統的不同位置上,根據在資料表被建立時所設定的規則。實際上,資料表的不同部份是以被切割的表格存放在不同位置,但是從使用者的觀點來看,被分割的表格仍是單一的資料表。在語法上,這項功能實現成CREATE TABLE、ALTER TABLE以及EXPLAIN...SELECT等語法的擴充設定。在MySQL 5.1.6的版本中,對被分割的資料表作查詢(queries),可以獲得"partition pruning(分割資料表修剪,可以大幅提昇查詢效率)"的好處。在某些案例中,相較未分割的資料表,同樣的查詢語法在已分割的資料表上能夠獲得速度優異的結果。請看 Chapter 18, Partitioning以獲得更多資訊 (Author: Mikael Ronström)

  • Row-based replication(以資料列為基礎的複製模式). 在過去MySQL從Master端複製到Slave端的功能是以SQL語法為基礎,這被稱作陳述式基礎(statement-based)的複製模式。在MySQL 5.1.5的版本,提供其他複製的基準,這被稱作資料列基礎(row-based)的複製模式。取代Master端藉由傳送SQL語法複製到Slave端的方法,Master將事件(events)寫到它自己的二進位資料紀錄檔(binary log), 進而指出個別的資料列如何被改變,在MySQL 5.1.8的版本中,提供第三種選項"混合模式(mixed)",它預設使用陳述式基礎的複製模式,而只針對特定的案例切換成資料列為基礎的複製模式。閱讀 Section 16.1.2, “Replication Formats”. (Authors: Lars Thalmann, Guilhem Bichot, Mats Kindahl)

  • Plugin API(附加元件應用開發介面). MySQL 5.1增加具有彈性的附加元件開發介面,使得在執行階段可以加載及卸載不同的元件,而不用重新啟動伺服器,儘管這項工作目前還未全部完成,但全文檢索(full-text parsers)的附加元件已經在這種新的方向跨出第一步,這將能夠讓使用者實現他們自己的輸入過濾器(input filter)在被索引的文字,因此即使像PDF或其他類型的文件格式,也能夠提供全文搜尋的功能。A pre-parser full-text plugin performs the actual parsing and extraction of the text and hands it over to the built-in MySQL full-text search. See Section 22.2, “The MySQL Plugin Interface”. (Author: Sergey Vojtovich)

  • Event scheduler(事件排程工具). MySQL的事件(Events)是根據行程表安排執行的任務,當你建立一個事件時,你就建立了一個被命名的資料庫物件,包含一或多個SQL語法,一或多次定期被執行,在特定的日期或時間開始及結束。在概念上,這與Unix的crontab(also known as a “cron job”)工具很相似,也與Windows的工作排程類似。See Section 19.4, “Using the Event Scheduler”. (Author: Andrey Hristov)

  • Server log tables(伺服器紀錄資料表). 在MySQL 5.1之前,只能將一般查詢及緩慢查詢紀錄到磁碟上的紀錄檔,但在MySQL 5.1提供更有彈性的紀錄方式,紀錄可以像之前一樣寫入紀錄檔,但也可以寫到 general_logslow_log 的資料表中。 If logging is enabled, either or both destinations can be selected. The --log-output option controls the destination or destinations of log output. See Section 5.2.1, “Selecting General Query and Slow Query Log Output Destinations”. (Author: Petr Chardin)

  • Upgrade program(升級程式). The mysql_upgrade program (available as of MySQL 5.1.7) checks all existing tables for incompatibilities with the current version of MySQL Server and repairs them if necessary. This program should be run for each MySQL upgrade. See Section 4.4.8, “mysql_upgrade — Check Tables for MySQL Upgrade”. (Authors: Alexey Botchkov, Mikael Widenius)

  • MySQL Cluster(叢集). MySQL Cluster is now released as a separate product, based on MySQL 5.1 but with the addition of the NDBCLUSTER storage engine. Clustering support is no longer available in mainline MySQL 5.1 releases. MySQL Cluster releases are identified by a 3-part NDB version number; currently, the MySQL Cluster NDB 6.2 and MySQL Cluster NDB 6.3 release series are available for production use.

    Some of the changes in MySQL Cluster since MySQL 5.0 are listed here:

    • MySQL Cluster replication. Replication between MySQL Clusters is now supported. It is now also possible to replicate between a MySQL Cluster and a non-cluster database. See Section 17.11, “MySQL Cluster Replication”.

    • MySQL Cluster disk data storage. Formerly, the NDBCLUSTER storage engine was strictly in-memory; now, it is possible to store Cluster data (but not indexes) on disk. This allows MySQL Cluster to scale upward with fewer hardware (RAM) requirements than previously. In addition, the Disk Data implementation includes a new “no-steal” restoration algorithm for fast node restarts when storing very large amounts of data (terabyte range). See Section 17.12, “MySQL Cluster Disk Data Tables”, for more information.

    • Improved backups for MySQL Cluster. A fault arising in a single data node during a Cluster backup no longer causes the entire backup to be aborted, as occurred in previous versions of MySQL Cluster.

    Many other new features and improvements have been made to the NDBCLUSTER storage engine in MySQL Cluster NDB 6.2 and MySQL Cluster NDB 6.3; for more information about these, see Section 17.15, “MySQL Cluster Development Roadmap”.

  • Backup of tablespaces. The mysqldump utility now supports an option for dumping tablespaces. Use -Y or --all-tablespaces to enable this functionality.

  • Improvements to INFORMATION_SCHEMA. MySQL 5.1 provides much more information in its metadata database than was available in MySQL 5.0. New tables in the INFORMATION_SCHEMA database include FILES, EVENTS, PARTITIONS, PROCESSLIST, ENGINES, and PLUGINS.

  • XML functions with XPath support(XML函數包含XPath的支援). ExtractValue() returns the content of a fragment of XML matching a given XPath expression. UpdateXML() replaces the element selected from a fragment of XML by an XPath expression supplied by the user with a second XML fragment (also user-supplied), and returns the modified XML. See Section 11.10, “XML Functions”. (Author: Alexander Barkov)

  • Load emulator(負載模擬工具). The mysqlslap program is designed to emulate client load for a MySQL server and report the timing of each stage. It works as if multiple clients were accessing the server. See Section 4.5.7, “mysqlslap — Load Emulation Client”. (Authors: Patrick Galbraith, Brian Aker)

安裝指南
延伸閱讀

沒有留言:

張貼留言

lyhcode by lyhcode
歡迎轉載,請務必註明出處!