Tebe
Tebe

Reputation: 3214

Yii 1.15 ORM - too many SHOW statements

Yii's ORM uses too many SHOW table statements.

It looks so in logs:

enter image description here

PhpMyadmin's stats says that SHOW statements take about 46% resources of MySql:

enter image description here

Is there any way to mitigate this?

EDIT

I forgot to add that I have caching enabled like the following:

schemaCachingDuration => 7200

As I understand it should cache table schema for 2 hours. But it's updated anyway.

Upvotes: 1

Views: 39

Answers (1)

BHoft
BHoft

Reputation: 1663

You can set the schemaCachingDuration (at least in your live system)

schemaCachingDuration

  • is this on your development version? Could be that if define('YII_DEBUG', true); it isn't cached.
  • have you enabled 'cache' as well ? final deployment

You also have to set the cachesetting: e.g.

'cache'=>array(
        //'class'=>'CApcCache',
        //'class'=>'CDummyCache',
        'class'=>'CDbCache',
),

Upvotes: 1

Related Questions