Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better performance from mapper custom without relations #270

Open
dertin opened this issue Aug 1, 2018 · 0 comments
Open

Better performance from mapper custom without relations #270

dertin opened this issue Aug 1, 2018 · 0 comments

Comments

@dertin
Copy link

dertin commented Aug 1, 2018

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.

Tested in blackfire.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants