In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "using PHP to compare the performance of mysql and oracle databases". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "using PHP even mysql and oracle database performance comparison" bar!
Test hardware instructions:
My favorite phone is used in the test, and the configuration is as follows:
CPU:C433
Memory: 128m
Hard disk: cool Fish 2 Generation 20g
Test software description:
Under WIN32, windows nt server4,sp5,apache 1.3.12 php3.0.15 and php4rc1,mysql 3.22.29 Oracle 8.0.5 are used.
Bluepoint linux1.0, apache 1.3.12 and php4rc1,mysql 3.22.32 are used in linux.
Test code description:
Using a very simple table, mysql and oracle use the same table structure, with only three fields, with the following structure:
The table structure of mysql:
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)
);
The structure of oracle:
CREATE TABLE PHP_ORACLE. "BOARD"
("BOARD_ID" FLOAT
"BOARD_NAME" CHAR (16) NOT NULL
"BOARD_MANAGER" CHAR (20))
We only tested the time taken by the INSERT operation, not for select.
Because only PHP3 can connect to the oracle database under win32, only the performance of connecting to oracle with PHP3 is tested. Phase
After the official version of PHP4 comes out, the speed of using PHP4 to connect to oracle should be improved.
Under LINUX, because I didn't install oracle, I only tested the performance of mysql. It is said that under LINUX, oracle
Its performance is good, but it can't be tested.
And we put all the code used for database connections and oracle to analyze sql statements outside the statistical code.
So the time from the test is only the time spent performing the SQL operation
The program used to test mysql:
$dblink=mysql_connect ("localhost", "root", "shh223")
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 ($iSuppli.
The program used to test oracle:
$handle=OCILogon ("php_oracle", "php_oracle")
$counter=1
Set_time_limit (300)
$query= "insert into board (board_id,board_name,board_manager) values (: board_id,'test','test')"
$state=OCIParse ($handle, $query)
OCIBindByName ($state, ": board_id", & $iJE32)
$begin_time=time ()
For ($iSuppli.
Test results:
Environment: win32+apache+php4+mysql
Result: 28 seconds
Environment: win32+apache+php3+mysql
Result: 34 seconds
Environment: win32+apache+php3+oracle8.0.5 (oci function)
Result: 46 seconds
Environment: linux+apache+php4+mysql
Result: 10 seconds
Conclusion:
Under WIN32, the performance of mysql is not very good, but it is still much faster than oracle8, especially when I am
The database connection statement is not included in the test program, so the test result is only the cost of inserting data
The time, while the oracle connection, God, is too slow! On my machine, connect once for at least 1 mi 2 seconds.
Under LINUX, the performance of mysql has a great leap forward compared with that under WIN32. Plummeted from 28 seconds to 10 seconds.
So, if you don't need support for stored procedures,
At this point, I believe you have a deeper understanding of "using PHP to compare the performance of mysql and oracle databases". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.