Skip to content

@AD7six /find.php secret

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
<?php
$posts = $this->Post->find('all', array(
'contain' => array(
'Comment' => array(
'Commenter'
),
)
));
1 SELECT `Post`.`id`, `Post`.`user_id`, `Post`.`title`, `Post`.`body`, `Post`.`published`, `Post`.`allow_comments`, `Post`.`created` FROM `test_database_name`.`posts` AS `Post` WHERE 1 = 1 5 5 0
2 SELECT `Comment`.`id`, `Comment`.`post_id`, `Comment`.`user_id`, `Comment`.`comment`, `Comment`.`created` FROM `test_database_name`.`comments` AS `Comment` WHERE `Comment`.`post_id` IN (1, 2, 3, 4, 5) 3 3 1
3 SELECT `Commenter`.`id`, `Commenter`.`name`, `Commenter`.`bio`, `Commenter`.`created` FROM `test_database_name`.`users` AS `Commenter` WHERE `Commenter`.`id` = 1 1 1 0
4 SELECT `Commenter`.`id`, `Commenter`.`name`, `Commenter`.`bio`, `Commenter`.`created` FROM `test_database_name`.`users` AS `Commenter` WHERE `Commenter`.`id` = 2 1 1 0
5 SELECT `Commenter`.`id`, `Commenter`.`name`, `Commenter`.`bio`, `Commenter`.`created` FROM `test_database_name`.`users` AS `Commenter` WHERE `Commenter`.`id` = 1 1 1 0
@AD7six
Owner

5 posts, and 3 comments = 5 queries
100 posts and 3 comments = 5 queries
5 posts and 100 comments = 102 queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.