The data required by the Data Cube is rarely or never updated once it is written. This kind of data is well suited for compression to reduce disk usage. MySQL itself provides two compression methods - 1. Test environment 1.1 Hardware and Software A 64-bit MySQL is placed on a 7200 rpm SAT hard disk, not in No optimization was made to MySQL and 1.2 Table Structure2,424,753 records, actual data of a shard in the production environment; The joint indexes ( As a sub-column, 2. Test Purpose2.1 Comparison of compression spaceThe greater the compression rate, the smaller the disk space occupied, which directly reduces the data storage cost; 2.2 Query Performance Comparison There should not be a noticeable degradation in query performance after compression. 3. Testing Tools3.1 mysqlslap The official tool is of course the best choice. For an introduction to 3.2 Test query A total of 9973 actual SQL statements accessing the 4. Test conclusion
Based on the test data given in the table above, we can simply draw the following conclusions:
So, we seem to be able to conclude that for tables that require online queries, Why is We know that With this consensus, let's take a test SQL to analyze why there is such a big difference in query performance before and after not using the index. In our test SQL, there is such a line: SELECT c1,c2,...,cn FROM mysqlslap.rpt_topranks_v3 WHERE ... AND partition_by1 = '50008090' ORDER BY added_quantity3 DESC LIMIT 500 As we said before, the test table has an index on the mysql> EXPLAIN -> SELECT ... FROM mysqlslap.rpt_topranks_v3 -> WHERE ... AND partition_by1 = '50008090' -> ORDER BY added_quantity3 DESC -> LIMIT 500\G *************************** 1. row *************************** id: 1 select_type: SIMPLE TABLE: rpt_topranks_v3 type: ref possible_keys: idx_toprank_pid,idx_toprank_chg KEY: idx_toprank_pid key_len: 99 ref: const rows: 2477 Extra: USING WHERE; USING filesort 1 row IN SET (0.00 sec) As we expected, this query uses the index on the Let's take a look at the EXPLAIN results of this SQL on the archive table: mysql> EXPLAIN -> SELECT ... FROM mysqlslap.rpt_topranks_v3_<strong>archive</strong> -> WHERE ... AND partition_by1 = '50008090' -> ORDER BY added_quantity3 DESC -> LIMIT 500\G *************************** 1. row *************************** id: 1 select_type: SIMPLE TABLE: rpt_topranks_v3_archive type: ALL possible_keys: NULL KEY: NULL key_len: NULL ref: NULL rows: 2424753 Extra: USING WHERE; USING filesort 1 row IN SET (0.00 sec) EXPLAIN says: " I don't have any indexes available, so I can only scan the entire table for 2424753 rows and then do a This is the end of this article about the details of MySQL data compression performance comparison. For more information about MySQL data compression performance comparison, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: How to use Docker to build a development environment (Windows and Mac)
>>: Double loading issue when the page contains img src
Background Here's what happened, Luzhu accide...
This article shares with you the Ubuntu server ve...
Table of contents 0x01. Install the Pagoda Panel ...
This article example shares the specific code for...
This is my first time using the element framework...
There are many Hadoop installation tutorials on L...
Without further ado, I will post the code for you...
<br />Original address: http://andymao.com/a...
1.1 Introduction to storage engines 1.1.1 File sy...
Summarize This article ends here. I hope it can b...
Table of contents Preface 1. Recursive components...
Preface: Integer is one of the most commonly used...
Original address: http://www.webdesignfromscratch...
1. Download 1. MySQL official website download ad...
Volume data volume is an important concept of Doc...