56,678
社区成员
发帖
与我相关
我的任务
分享
看到N多人比较这两个数据库,呵呵,我也来搞搞热闹,希望接下来都尽可能在应用角度去测试这次比较
本测试文档,采用GPL 协议,如转载请注明出处 : http://blog.bowenye.com/read.php?2
如商业,请联系本人 QQ : 84437129
先来收集几个官方的描述
MySQL AB是由MySQL创始人和主要开发人创办的公司。MySQL AB最初是由David Axmark、Allan Larsson和Michael“Monty”Widenius在瑞典创办的.
*MySQL是一种数据库管理系统
*MySQL是一种关联数据库管理系统。
*MySQL软件是一种开放源码软件。
*MySQL数据库服务器具有快速、可靠和易于使用的特点。
*MySQL服务器工作在客户端/服务器模式下,或嵌入式系统中。
*有大量可用的共享MySQL软件。
MySQL服务器采用了多层设计和独立模块
...(省去5000字)
PostgreSQL 是以加州大学伯克利分校计算机系开发的 POSTGRES, Version 4.2 为基础的对象关系型数据库管理系统(ORDBMS)。POSTGRES 领先的许多概念只是在非常迟的时候才出现在商业数据库中。
PostgreSQL 是最初伯克利代码的一个开放源码的继承人。它支持大部分 SQL 标准并且提供了许多其它现代特性:
复杂查询
外键
触发器
视图
事务完整性
多版本并发控制
另外,PostgreSQL 可以用许多方法进行扩展,比如通过增加新的:
数据类型
函数
操作符
聚集函数
索引方法
过程语言
并且,因为许可证的灵活,任何人都可以以任何目的免费使用、修改、分发 PostgreSQL ,不管是私用、商用、还是学术研究使用。
...(此处也省去5000字)
./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-shared --enable-static --with-comment --with-man --with-docs --with-pthread --enable-assembler --with-mysqld-ldflags=-all-static --with-plugins=innobase
make
make install
./configure --enable-FEATURE --enable-thread-safety
gmake
gmake install
skip-federated
Starting MySQL.Manager of pid-file quit without updating fi[FAILED]
checking for PostgreSQL support for PDO... yes
checking for pg_config... not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
原始代码
80002 for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do
80003 if test -x $i/pg_config; then
80004 PG_CONFIG="$i/pg_config"
80005 break;
80006 fi
...
80021 if test "$PHP_PGSQL" = "yes"; then
80022 PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql/bin"
80023 else
80024 PGSQL_SEARCH_PATHS=$PHP_PGSQL
80025 fi
修改后代码
80002 for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/postgres/bin/ /usr/local/bin /usr/bin ""; do
80003 if test -x $i/pg_config; then
80004 PG_CONFIG="$i/pg_config"
80005 break;
80006 fi
...
80021 if test "$PHP_PGSQL" = "yes"; then
80022 PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/postgres/bin"
80023 else
80024 PGSQL_SEARCH_PATHS=$PHP_PGSQL
80025 fi
$ export PGSQL_INCLUDE=/usr/local/postgres/include
$ export PGSQL_LIBDIR=/usr/local/postgres/lib
...
--with-pdo-pgsql=/usr/local/postgres/ --with-pgsql=/usr/local/postgres/
---MySQL 的一个表,MySQL正常情况会分myisam 与innodb 所以在建表的时候,为公平,再多建一个innodb
---MyISAM
CREATE TABLE IF NOT EXISTS uchome_docomment (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
upid int(10) unsigned NOT NULL DEFAULT '0',
doid mediumint(8) unsigned NOT NULL DEFAULT '0',
uid mediumint(8) unsigned NOT NULL DEFAULT '0',
username char(15) NOT NULL DEFAULT '',
dateline int(10) unsigned NOT NULL DEFAULT '0',
message text NOT NULL,
ip char(20) NOT NULL DEFAULT '',
grade smallint(6) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY ( id ),
KEY doid ( doid )
) ENGINE=MyISAM ;
---innodb
CREATE TABLE IF NOT EXISTS uchome_docomment_innodb (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
upid int(10) unsigned NOT NULL DEFAULT '0',
doid mediumint(8) unsigned NOT NULL DEFAULT '0',
uid mediumint(8) unsigned NOT NULL DEFAULT '0',
username char(15) NOT NULL DEFAULT '',
dateline int(10) unsigned NOT NULL DEFAULT '0',
message text NOT NULL,
ip char(20) NOT NULL DEFAULT '',
grade smallint(6) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY ( id ),
KEY doid ( doid )
) ENGINE=InnoDB ;
-- PostgreSQL 使用专有的存贮格式,目前只有一种
CREATE TABLE uchome_docomment (
id serial,
upid integer NOT NULL DEFAULT '0',
doid integer NOT NULL DEFAULT '0',
uid integer NOT NULL DEFAULT '0',
username char(15) NOT NULL DEFAULT '',
dateline integer NOT NULL DEFAULT '0',
message text NOT NULL,
ip char(20) NOT NULL DEFAULT '',
grade integer NOT NULL DEFAULT '0',
PRIMARY KEY (id,doid)
) ;
看到N多人比较这两个数据库,呵呵,我也来搞搞热闹,希望接下来都尽可能在应用角度去测试这次比较
本测试文档,采用GPL 协议,如转载请注明出处 : http://blog.bowenye.com/read.php?2
如商业,请联系本人 QQ : 84437129
先来收集几个官方的描述
MySQL AB是由MySQL创始人和主要开发人创办的公司。MySQL AB最初是由David Axmark、Allan Larsson和Michael“Monty”Widenius在瑞典创办的.
*MySQL是一种数据库管理系统
*MySQL是一种关联数据库管理系统。
*MySQL软件是一种开放源码软件。
*MySQL数据库服务器具有快速、可靠和易于使用的特点。
*MySQL服务器工作在客户端/服务器模式下,或嵌入式系统中。
*有大量可用的共享MySQL软件。
MySQL服务器采用了多层设计和独立模块
...(省去5000字)
PostgreSQL 是以加州大学伯克利分校计算机系开发的 POSTGRES, Version 4.2 为基础的对象关系型数据库管理系统(ORDBMS)。POSTGRES 领先的许多概念只是在非常迟的时候才出现在商业数据库中。
PostgreSQL 是最初伯克利代码的一个开放源码的继承人。它支持大部分 SQL 标准并且提供了许多其它现代特性:
复杂查询
外键
触发器
视图
事务完整性
多版本并发控制
另外,PostgreSQL 可以用许多方法进行扩展,比如通过增加新的:
数据类型
函数
操作符
聚集函数
索引方法
过程语言
并且,因为许可证的灵活,任何人都可以以任何目的免费使用、修改、分发 PostgreSQL ,不管是私用、商用、还是学术研究使用。
...(此处也省去5000字)
./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-shared --enable-static --with-comment --with-man --with-docs --with-pthread --enable-assembler --with-mysqld-ldflags=-all-static --with-plugins=innobase
make
make install
./configure --enable-FEATURE --enable-thread-safety
gmake
gmake install
skip-federated
Starting MySQL.Manager of pid-file quit without updating fi[FAILED]
checking for PostgreSQL support for PDO... yes
checking for pg_config... not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
原始代码
80002 for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do
80003 if test -x $i/pg_config; then
80004 PG_CONFIG="$i/pg_config"
80005 break;
80006 fi
...
80021 if test "$PHP_PGSQL" = "yes"; then
80022 PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql/bin"
80023 else
80024 PGSQL_SEARCH_PATHS=$PHP_PGSQL
80025 fi
修改后代码
80002 for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/postgres/bin/ /usr/local/bin /usr/bin ""; do
80003 if test -x $i/pg_config; then
80004 PG_CONFIG="$i/pg_config"
80005 break;
80006 fi
...
80021 if test "$PHP_PGSQL" = "yes"; then
80022 PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/postgres/bin"
80023 else
80024 PGSQL_SEARCH_PATHS=$PHP_PGSQL
80025 fi
$ export PGSQL_INCLUDE=/usr/local/postgres/include
$ export PGSQL_LIBDIR=/usr/local/postgres/lib
...
--with-pdo-pgsql=/usr/local/postgres/ --with-pgsql=/usr/local/postgres/
---MySQL 的一个表,MySQL正常情况会分myisam 与innodb 所以在建表的时候,为公平,再多建一个innodb
---MyISAM
CREATE TABLE IF NOT EXISTS uchome_docomment (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
upid int(10) unsigned NOT NULL DEFAULT '0',
doid mediumint(8) unsigned NOT NULL DEFAULT '0',
uid mediumint(8) unsigned NOT NULL DEFAULT '0',
username char(15) NOT NULL DEFAULT '',
dateline int(10) unsigned NOT NULL DEFAULT '0',
message text NOT NULL,
ip char(20) NOT NULL DEFAULT '',
grade smallint(6) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY ( id ),
KEY doid ( doid )
) ENGINE=MyISAM ;
---innodb
CREATE TABLE IF NOT EXISTS uchome_docomment_innodb (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
upid int(10) unsigned NOT NULL DEFAULT '0',
doid mediumint(8) unsigned NOT NULL DEFAULT '0',
uid mediumint(8) unsigned NOT NULL DEFAULT '0',
username char(15) NOT NULL DEFAULT '',
dateline int(10) unsigned NOT NULL DEFAULT '0',
message text NOT NULL,
ip char(20) NOT NULL DEFAULT '',
grade smallint(6) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY ( id ),
KEY doid ( doid )
) ENGINE=InnoDB ;
-- PostgreSQL 使用专有的存贮格式,目前只有一种
CREATE TABLE uchome_docomment (
id serial,
upid integer NOT NULL DEFAULT '0',
doid integer NOT NULL DEFAULT '0',
uid integer NOT NULL DEFAULT '0',
username char(15) NOT NULL DEFAULT '',
dateline integer NOT NULL DEFAULT '0',
message text NOT NULL,
ip char(20) NOT NULL DEFAULT '',
grade integer NOT NULL DEFAULT '0',
PRIMARY KEY (id,doid)
) ;
select * from table