简体   繁体   中英

CakePHP long sql query

My Project based on CakePHP framework works with MySQL DB. And there sometimes is running a long sql query. And I can't load any page in my project during this query. But when I execute this SQL query in Adminer (light PhpMyAdmin), I can load any page and any select from DB. Can you help me to configure it?

You mentioned that the problematic query is:

select a.* from table_b b inner join table_a a on b.id = a.b_id where b.some_field = 'some text' 

You need to make sure that there are indexes on the following fields:

b.id
a.b_id
b.some_field

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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