2009年9月30日星期三

Re: [fw-db] Zend_Db::fetchAll() unacceptably slow

Looks like slow db connection http://www.screencast.com/users/umpirsky/folders/Jing/media/953fb733-e2e8-4456-a9cd-0e4570722110

What can I try? Maybe other server :P

Regards,
Saša Stamenković


On Wed, Sep 30, 2009 at 2:12 PM, Benjamin Eberlei <kontakt@beberlei.de> wrote:

Hello,

can you make a tracedump or a kcachegrind output using xdebug
for just your use-case?

Otherwise its impossible to tell what causes this.

greetings,
Benjamin

On Wed, 30 Sep 2009 05:03:22 -0700 (PDT), umpirsky <umpirsky@gmail.com>
wrote:
> Hi.
>
> I have mysql table:
>
> CREATE TABLE `brand` (
>   `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Car brand ID',
>   `title` varchar(32) default NULL COMMENT 'Car brand title',
>   PRIMARY KEY  (`id`)
> ) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8 CHECKSUM=1
> DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
>
> with 93 records inserted.
>
> I'm using Zend_Db with MYSQLI adapter. When I execute fetchAll(null,
> 'title') it takes 15 seconds to complete fetch!!! This is terrible slow,
> isn't it?
>
> Profiler says:
>
>  0.00114       SELECT `brand`.* FROM `brand` ORDER BY `title` ASC
>
> which is ok and blazing fast.
>
> Looks like fetchAll is wasting time somewhere. This is not unacceptable.
>
> Any idea?

没有评论: