简体   繁体   English

mysql,innodb设置,可更快地执行查询

[英]mysql, innodb settings for faster execution of query

I have 4 large table and im trying to execute sql query on it. 我有4个大表,即时通讯试图在上面执行sql查询。 The query is taking much time to execute so , i want to reduce the execution time for better performance and i'm struggling with this so i need help 该查询需要花费大量时间来执行,因此,我想减少执行时间以获得更好的性能,而我为此苦苦挣扎,因此我需要帮助

i'm using mysql 5.7.8 in linux os, 12 GB RAM 我在Linux OS中使用mysql 5.7.8、12 GB RAM

*This is my.cnf config * my.cnf file *这是my.cnf配置* my.cnf文件

 [mysqld]    
innodb_buffer_pool_size=10G     
innodb_log_buffer_size=2G    
innodb_buffer_pool_instances=16    
innodb_thread_concurrency=0    
innodb_flush_log_at_trx_commit=0    
sync_binlog=0    
innodb_flush_method=O_DIRECT    
skip_name_resolve    
innodb_io_capacity=1000    
innodb_io_capacity_max=3000    
innodb_buffer_pool_dump_at_shutdown=ON    
innodb_buffer_pool_load_at_startup=ON    
query_cache_type = 1    
query_cache_size = 256M    
innodb_read_io_threads=8    
innodb_write_io_threads=4

Nothing wrong with status vars, very low activity. 状态变量没有问题,活动非常少。
Try to add composite index (isCancel, User) . 尝试添加复合索引(isCancel, User)
If the query will remain slow, than delete this index and try to add new one (isCancel, User, Quarter, Year, ClaimType, Units, Amount) that will allow to get all data from index for this query. 如果查询仍然很慢,则删除该索引并尝试添加新索引(isCancel, User, Quarter, Year, ClaimType, Units, Amount) ,以允许从该查询的索引中获取所有数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM