Mysql5.1 character set testing

1,005 views

Published on

Mysql5.1 character set testing

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,005
On SlideShare
0
From Embeds
0
Number of Embeds
262
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mysql5.1 character set testing

  1. 1. Test character set Philip zhong
  2. 2. One transaction contain following statements• Point queries: SELECT c FROM test_latin WHERE id=N• Range queries: SELECT c FROM test_latin WHERE id BETWEEN N AND M• Range SUM() queries: SELECT SUM(K) FROM test_latin WHERE id BETWEEN N and M• Range ORDER BY queries:SELECT c FROM test_latin WHERE id between N and M ORDER BY c• Range DISTINCT queries:SELECT DISTINCT c FROM test_latin WHERE id BETWEEN N and M ORDER BY c• UPDATEs on index column:UPDATE test_latin SET k=k+1 WHERE id=N• UPDATEs on non-index column:UPDATE test_latin SET c=N WHERE id=M• DELETE queries:DELETE FROM test_latin WHERE id=N• INSERT queries:INSERT INTO test_latin VALUES (...)
  3. 3. Set session parameters• Set Limit for total number of requests=500• Set inserting records =1000000• Set Range size for range queries=100• Set Number of point select queries in a single transaction=10• Set Number of simple range queries in a single transaction=1• Set Number of SUM range queries in a single transaction=1• Set Number of ORDER range queries in a single transaction=1• Set Number of DISTINCT range queries in a single transaction =1• Set Number of index UPDATE queries in a single transaction=1• Set Number of non-index UPDATE queries in a single transaction =1• Set Time in microseconds to sleep after each connection to database = 1000• Set Minimum time in microseconds to sleep after each request =0• Set Maximum time in microseconds to sleep after each request =0
  4. 4. Tables structureCREATE TABLE test_latin ( id int(10) unsigned NOT NULL, k int(10) unsigned NOT NULL DEFAULT 0, c char(120) NOT NULL DEFAULT , pad char(60) NOT NULL DEFAULT , PRIMARY KEY (id), KEY k (k)) ENGINE=InnoDB DEFAULT CHARSET=latin1CREATE TABLE test_utf8 ( id int(10) unsigned NOT NULL, k int(10) unsigned NOT NULL DEFAULT 0, c char(120) NOT NULL DEFAULT , pad char(60) NOT NULL DEFAULT , PRIMARY KEY (id), KEY k (k)) ENGINE=InnoDB DEFAULT CHARSET=utf8
  5. 5. Create testing data scriptsDROP PROCEDURE IF EXISTS insert_data_english;DELIMITER //CREATE PROCEDURE insert_data_english()BEGIN DECLARE vCount bigint(12) DEFAULT 1; DECLARE vK bigint(12) DEFAULT 1; DECLARE vbuyerName varchar(128) DEFAULT 0bzhonglizhongli; DECLARE vSellerName varchar(128) DEFAULT 0szhonglizhongli; SET AUTOCOMMIT=0; WHILE vCount<=1000000 DO INSERT INTO test_latin(id,k,c,pad) VALUES(vCount,vK,vSellerName,vbuyerName); INSERT INTO test_utf8(id,k,c,pad) VALUES(vCount,vK,vSellerName,vbuyerName); set vCount=vCount+1; IF MOD(vCount,5000)=0 THEN set vK=vK+1; set vbuyerName=concat(vCount,bzhonglizhongli); set vSellerName=concat(vCount,szhonglizhongli); COMMIT; END IF; END WHILE; COMMIT;END;//DELIMITER ;
  6. 6. Result --using English charactersName latin1 utf8Concurrent Transactions:141.17 per sec Transactions:96.88 per secthreads=8 read/write requests:2682.26 per sec. read/write requests:1840.80 per sec total time:3.5418s total time:5.1608sConcurrent Transactions:180.04 per sec Transactions:169.45 per secthreads=16 read/write requests:3420.82 per sec read/write requests:3219.54 per sec total time:2.7771s total time:2.9507s
  7. 7. Latin(English) ResultConcurrent threads=8
  8. 8. UTF8(English) ResultConcurrent threads=8
  9. 9. Latin(English) ResultConcurrent threads=16
  10. 10. UTF8(English) ResultConcurrent threads=16
  11. 11. Result --using Chinese charactersName latin1 utf8Concurrent Transactions:177.59 per sec Transactions:115.20 per secthreads=8 read/write requests:3374.16 per sec read/write requests:2188.76 per sec total time:2.8155s total time:4.3404sConcurrent Transactions:160.13 per sec Transactions:123.72 per secthreads=16 read/write requests:3042.41 per sec read/write requests:2350.69 per sec total time:3.1225s total time:4.0414s
  12. 12. Latin(Chinese) ResultConcurrent threads=8
  13. 13. UTF8(Chinese) ResultConcurrent threads=8
  14. 14. Latin(Chinese) ResultConcurrent threads=16
  15. 15. UTF8(Chinese) ResultConcurrent threads=16

×