Answer the question
In order to leave comments, you need to log in
How to properly use the Query Query Builder in Yii2?
Rewrote the project from yii1 to yii2, brakes appeared. The heaviest page used to load 0.5-0.8 seconds. now the same page 5.8 sec. 1700 requests to the database are used, which takes 280 ms. I can not understand what the rest of the time is spent on. I don't use ActiveRecord, I use only the query builder.
In yii1 I accessed the database like this:
$command = Yii::app()->db->createCommand();
$command->from('user');
$result = $command->queryAll();
$query = new Query();
$query->from('user');
$result = $query->all();
Answer the question
In order to leave comments, you need to log in
Open Debug framework, find duplicate requests. Find out where they are made. Optimize the work so that the data from the database is reused, and not requested every time
With suspicion, you need to go to a fortune teller. Make debugging, determine what, where and how slows down and fix it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question