简体   繁体   中英

getQuery (Doctrine) is running VERY VERY slow

I have setup a virtualbox running Linux Mint 16 x64 for R&D with Symfony2/Doctrine2. I installed Symfony via composer and it installed Doctrine with it. I setup this up about 2-3 weeks ago so the version I'm using should be latest or at least very recent.

The virtual machine is running Apache/MySQL and PHP of course. I only have 1 new database/schema in MySQL database and I have only created 1 new table. This new table only has less than 15 records so it shouldn't take that long to retrieve all the records.

When I run a code like below, I get the results very quickly.

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

But when I use query (see code below), the webpage often times out or Firefox just crashes.

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

Any ideas what could be happening and how to fix it?

thanks very much

尝试使用:

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

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