亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

php - mysql query optimization problem?
大家講道理
大家講道理 2017-05-16 13:08:33
0
2
631
select count(*) as aggregate from `call_records` where (`CallType` = 'dialout' and `CalledNo` = '12345678910');

How to optimize this query? The premise is that the index cannot be created, because there are already several indexes in this table, which may cause the table to be locked.

大家講道理
大家講道理

光陰似箭催人老,日月如移越少年。

reply all(2)
給我你的懷抱

Is it hot data? If not, just make a script to run regularly and save the statistical count into another statistical table.
For hot data, see if the index you built before can be turned into a combined index. Because the B-tree starts from the left, if you build an (a, b, c), a and a, b and a, b, and c can be used. Used, the query function at the code layer pays attention to the field order.

PHPzhong

Re-optimize the index. There are too many single indexes, so try to build a joint index. If this statistics does not require real-time performance, use md5 (sql statement) as the key, use the result as the value, and store it in the cache (redis).

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template