1

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:

  1. Did you have the same issue with Yii2?
  2. What happened in this case? Is it fixed in the new Yii2 version?

1 Answer 1

-1

Is there an index on phonenumber in the User table? If not, then you should fix it and check the speed of the request.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I said it in the article. Do you have any suggestions?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.