I have found a way to make the answer quicker when I need to make a query without having to care about the relations of the entities.
faster
$this->connection()->fetchAll( 'SELECT test.*, foo.text FROM test INNER JOIN foo ON foo.id = test.idFoo' );
$this->connection()->executeUpdate('DELETE FROM test');
slower
$this->query('SELECT test.*, foo.text FROM test INNER JOIN foo ON foo.id = test.idFoo' );
The query() method applies actions in all relationships and this slows down the result, sometimes it is not necessary, when you can perform join in the sql statement.
I have found a way to make the answer quicker when I need to make a query without having to care about the relations of the entities.
faster
slower
$this->query('SELECT test.*, foo.text FROM test INNER JOIN foo ON foo.id = test.idFoo' );
The query() method applies actions in all relationships and this slows down the result, sometimes it is not necessary, when you can perform join in the sql statement.
Tested in blackfire.io