I'm using Yii2, version 2.0.35, apaoww/yii2-oci8 version **1.0.**0 to connect to Oracle DB
I have a table that stores users, it's about 8 millions rows. This table has an unique index by "phonenumber"
I got a performance issue when trying to get a user by phone number, as below:
$user = User::findOne(['phonenumber' => 'xxxx']);
It takes about 4s, but when I try to select directly in DB, it runs very fast.
Finally, I use Java, it can select very fast. I'm really disappointed with Yii2 and using Java is the best solution currently to solve this problem :(
So, My questions are:
- Did you have the same issue with Yii2?
- What happened in this case? Is it fixed in the new Yii2 version?
Is there an index on phonenumber in the User table? If not, then you should fix it and check the speed of the request.