the business table has too much data to design 4 sub-tables, and then the requirement is to export the full data of the 4 tables.
Test machine 4 cores. Start 4 threads to query at the same time, and summarize the final results.
if it takes 2s for a thread to query a table, it takes 2s for 4 threads to run (using cpu multi-core to run in parallel), but the reality is that 2 * 4 equals more than 8s.
A problem that has been bothering me for a long time. I hope the boss can help me. Thank you.
attach mysql parameter:
+-----------------------------------------+---------------------------+
| Variable_name | Value |
+-----------------------------------------+---------------------------+
| innodb_purge_threads | 0 |
| innodb_read_io_threads | 4 |
| innodb_thread_concurrency | 10 |
| innodb_thread_sleep_delay | 10000 |
| innodb_write_io_threads | 4 |
| max_delayed_threads | 20 |
| max_insert_delayed_threads | 20 |
| myisam_repair_threads | 1 |
| performance_schema_max_thread_classes | 50 |
| performance_schema_max_thread_instances | 1000 |
| pseudo_thread_id | 81 |
| thread_cache_size | 8 |
| thread_concurrency | 10 |
| thread_handling | one-thread-per-connection |
| thread_stack | 262144 |
+-----------------------------------------+---------------------------+
mysql version is 5.5.28