繁体   English   中英

getQuery(Doctrine)运行非常慢

[英]getQuery (Doctrine) is running VERY VERY slow

我已经设置了一个运行Linux Mint 16 x64的虚拟机,用于使用Symfony2 / Doctrine2进行研发。 我通过composer安装了Symfony,并用它安装了Doctrine。 我在大约2-3周前设置了这个版本,所以我使用的版本应该是最新版本,或者至少是最新版本。

虚拟机当然正在运行Apache / MySQL和PHP。 我在MySQL数据库中只有一个新的数据库/模式,我只创建了一个新表。 这个新表只有不到15条记录,因此检索所有记录不需要那么长时间。

当我运行如下代码时,我很快就得到了结果。

var_dump($this->getDoctrine()->getEntityManager()->getRepository("my-class-here")->find(1);

但是当我使用查询(参见下面的代码)时,网页经常超时或者Firefox崩溃。

var_dump($this->getDoctrine()->getEntityManager()->createQuery("SELECT s FROM my-class-here s");

任何想法可能发生什么以及如何解决它?

非常感谢

尝试使用:

\Doctrine\Common\Util\Debug::dump($this->getDoctrine()->getEntityManager()->createQuery("SELECT s FROM my-class-here s"));

暂无
暂无

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

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