Performance Comparison of MySQL and Oracle databases connected with PHP

Source: Internet
Author: User
Tags win32 oracle database

Test hardware description:
The test uses my machine. The configuration is as follows:
CPU: C433
Memory: 128 MB
Hard disk: Cool 2 generation 20G

Test Software description:
Windows nt server4, sp5, apache 1.3.12, php3.0.15, php4rc1, mysql 3.22.29, and oracle 8.0.5 are used in WIN32.
In linux, bluepoint linux1.0, apache 1.3.12, php4rc1, and mysql 3.22.32 are used.

Test Code description:
A simple table is used. mysql and oracle use the same table structure and have only three Fields. The structure is as follows:
Mysql table structure:
Create table board (
Board_id smallint (6) not null auto_increment,
Board_name char (16) not null,
Board_manager char (20 ),
Primary key (board_id)
);
Oracle structure:
Create table PHP_ORACLE. "BOARD"
("BOARD_ID" FLOAT,
"BOARD_NAME" CHAR (16) not null,
"BOARD_MANAGER" CHAR (20 ));

We only tested the INSERT operation time. For select, no tests were conducted.
In win32, only PHP3 can connect to the oracle Database. Therefore, only the performance of connecting oracle with PHP3 is tested. Phase
After the official version of PHP4 is released, the speed of connecting oracle with PHP4 should be improved.
In LINUX, I only tested the performance of mysql because I didn't install oracle. It is said that in LINUX, oracle
The performance is good, but cannot be tested.
In addition, we put all the code used for database connection and oracle to analyze SQL statements out of the statistical code.
Therefore, the test only takes time to execute SQL operations.

Programs used to test mysql:

<? Php
$ Dblink = mysql_connect ("localhost", "root", "shh123 ");
Mysql_select_db ("bbs ");
$ Counter = 1;
Set_time_limit (300 );
$ Query = "insert into board (board_name, board_manager) values ('test', 'test ')";
$ Begin_time = time ();
For ($ I = 1; $ I <= 10000; $ I ){
Mysql_db_query ("bbs", $ query );
$ Counter;
}
$ End_time = time ();
Mysql_close ($ dblink );
Echo "test db speed... <br> ";
Echo "begin time:". $ begin_time. "<BR> ";
Echo "<BR> end time:". $ end_time. "<BR> ";

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.