我网站的数据库已被托管方阻止...他们说您的查询花费了太多时间来执行...他们发送的消息是:
This message is to advise you of a temporary block placed on your database. The database "**DATABASE NAME**" was found to be consuming an inordinate amount of processor time, to the point of degrading overall system performance. While we do limit each account to no more than 25% of a system's CPU in our terms of service, we do not actively disable accounts until they greatly exceed that number, which is what happened in this case.
Running Processes:
fastlynx 26884 0.3 0.0 0 0 ? ZN 23:26 0:00 [php] <defunct>
Running Queries:
*************************** 1. row ***************************
USER: USERNAME
DB: SB_NAME
STATE: optimizing
TIME: 40
COMMAND: Query
INFO: SELECT * FROM price WHERE country LIKE '27'/*--*/and/*--*//*!30000if(ascii(substring((user()),11,1))<121,BENCHMARK(151973069.6,MD5(0x41)),0)*//*--*/and/*--*/'x'='x%' GROUP BY country ASC order by country asc limit 0, 12
*************************** 2. row ***************************
USER: USERNAME
DB: DB_NAME
STATE: optimizing
TIME: 54
COMMAND: Query
INFO: SELECT * FROM price WHERE country LIKE '27'/*--*/and/*--*//*!30000if(ascii(substring((user()),4,1))<122,BENCHMARK(151973069.6,MD5(0x41)),0)*//*--*/and/*--*/'x'='x%' GROUP BY country ASC order by country asc limit 0, 12
从上面看来,来自单个表的查询正在花费最大执行时间......我已经通过 mysql 控制面板优化了数据库中的所有表。伙计们..帮我处理这种情况。提前致谢....
编辑 :
实际查询如下:
SELECT * FROM price WHERE country LIKE 'G%' GROUP BY country ASC limit 0, 12
OR
SELECT * FROM price WHERE prefix LIKE '91%' GROUP BY country ASC limit 0, 12
还有一件事……我有时也使用 NOT LIKE 像这样:
SELECT * FROM price WHERE country LIKE 'G%' AND country NOT LIKE 'INDIA%' GROUP BY country ASC limit 0, 12