此代码正在无限期加载:
$answer_articles = $bdd->prepare(
"SELECT *
FROM todo
LEFT JOIN links_task_text
ON links_task_text.links_task_text_id_task = todo.ID
WHERE todo.site = ?");
$answer_articles->execute(array('xxx'));
exit();
当然,这个代码是有效的:
$answer_articles = $bdd->prepare(
"SELECT *
FROM todo
WHERE site = ?");
$answer_articles->execute(array('xxx'));
exit();
//working and no loading delays
这个代码也在起作用:
$answer_articles = $bdd->prepare(
"SELECT * FROM todo
INNER JOIN links_task_text
ON links_task_text.links_task_text_id_task = todo.ID
WHERE todo.site = ?");
$answer_articles->execute(array('xxx'));
exit();
//works but it's not what I need
``` `links_task_text.links_task_text_id_task` 以及 `todo.ID` 是int。
我不明白为什么左连接不起作用。一些想法?
1条答案
按热度按时间yacmzcpb1#
列链接\u任务\u文本\u id \u任务上有索引吗?
如果不是,则可能是查询正在链接\u任务\u文本上运行完整表扫描,这需要很长时间。