yii2-redis icon indicating copy to clipboard operation
yii2-redis copied to clipboard

ActiveRecord is slow when use where condition.

Open dmitriybelyy opened this issue 10 years ago • 1 comments

ActiveRecord is very flat and slow (if we have many records at redis hash) when we try get with where condition. For example:

RedisModelAR::find()
->where(['login' => $login])
->one();

Because when go to findByPk use HGETALL.

What about rewrite logic at ActiveQuery with HMGET etc. for best performance ? And fields(AR attributes) store as hash field redis(hmset) not json or serialize.

dmitriybelyy avatar May 08 '15 09:05 dmitriybelyy

Any idea on how to do it? If yes, would you mind working on a pull request?

samdark avatar May 25 '15 22:05 samdark