Yii built-in RBAC Performance Concern

Hi all,

I am new to Yii and RBAC as well, I found that the Yii RBAC database table name AuthAssignment, have the userid column as varchar.

Will there be any performance issue when the number of users in the web application reach over thousand and more? As far as I realize string comparison in database is far more slow then integer. Every time the RBAC check for access privilege, the code need to search from the database table using string(varchar) comparison.

Yii is designed to be like this, must has his own reason, any expert here has advice to me why?

I try to use Yii's RBAC for my web apps, which possible can reach >100K of members, I am concerning about the performance…


The RBAC id column has been designed to accomodate usernames as well as just integer user IDs.  If you don't need to store alphanum, can you not simply change the AuthAssignment table schema to make the ID column an integer datatype?  I would think that this would resolve any performance issue.


Thanks Alex, I modify the code and it is working with no problem, I only store int type of userid.

Do you think will this course any problem to Yii's Authorization Manager?

This should be fine.

;) Thanks all!