(0.1ms) begin transaction ----------------------------- EagerCountingTest: test_truth -----------------------------  (0.0ms) rollback transaction  (1.9ms) CREATE TABLE "actions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "visit_id" integer, "product_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)   (0.1ms) select sqlite_version(*)  (1.6ms) CREATE INDEX "index_actions_on_product_id" ON "actions" ("product_id")  (0.1ms) SELECT sql FROM sqlite_master WHERE name='index_actions_on_product_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_actions_on_product_id' AND type='index'  (1.4ms) CREATE INDEX "index_actions_on_visit_id" ON "actions" ("visit_id")  (1.8ms) CREATE TABLE "comments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "commentable_id" integer, "commentable_type" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (1.5ms) CREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")  (1.9ms) CREATE TABLE "countries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (1.7ms) CREATE TABLE "places" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "country_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)   (1.5ms) CREATE INDEX "index_places_on_country_id" ON "places" ("country_id")  (1.9ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)   (1.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (1.9ms) CREATE TABLE "visits" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "place_id" integer, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)   (1.5ms) CREATE INDEX "index_visits_on_place_id" ON "visits" ("place_id")  (0.1ms)  SELECT sql FROM sqlite_master WHERE name='index_visits_on_place_id' AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name='index_visits_on_place_id' AND type='index'   (2.0ms) CREATE INDEX "index_visits_on_user_id" ON "visits" ("user_id")  (2.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)   (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.1ms) SELECT version FROM "schema_migrations"  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727082016')  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081137')  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081314')  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081755')  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081827')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081904')  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081905') ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 08:47:53.308271"], ["updated_at", "2015-07-27 08:47:53.308271"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 08:47:53.311702"], ["updated_at", "2015-07-27 08:47:53.311702"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 08:47:53.331525"], ["updated_at", "2015-07-27 08:47:53.331525"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 08:47:53.333282"], ["updated_at", "2015-07-27 08:47:53.333282"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 08:47:53.334657"], ["updated_at", "2015-07-27 08:47:53.334657"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.6ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 08:55:20.514776"], ["updated_at", "2015-07-27 08:55:20.514776"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 08:55:20.517809"], ["updated_at", "2015-07-27 08:55:20.517809"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 08:55:20.529874"], ["updated_at", "2015-07-27 08:55:20.529874"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 08:55:20.531318"], ["updated_at", "2015-07-27 08:55:20.531318"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 08:55:20.532470"], ["updated_at", "2015-07-27 08:55:20.532470"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.3ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (1.3ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:01:29.655047"], ["updated_at", "2015-07-27 09:01:29.655047"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:01:29.659346"], ["updated_at", "2015-07-27 09:01:29.659346"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:01:29.672634"], ["updated_at", "2015-07-27 09:01:29.672634"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:01:29.679322"], ["updated_at", "2015-07-27 09:01:29.679322"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:01:29.681007"], ["updated_at", "2015-07-27 09:01:29.681007"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:01:29.682373"], ["updated_at", "2015-07-27 09:01:29.682373"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:01:29.683813"], ["updated_at", "2015-07-27 09:01:29.683813"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:01:29.685249"], ["updated_at", "2015-07-27 09:01:29.685249"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:01:29.696941"], ["updated_at", "2015-07-27 09:01:29.696941"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:01:29.698324"], ["updated_at", "2015-07-27 09:01:29.698324"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:01:29.700523"], ["updated_at", "2015-07-27 09:01:29.700523"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:01:29.702153"], ["updated_at", "2015-07-27 09:01:29.702153"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:01:29.703672"], ["updated_at", "2015-07-27 09:01:29.703672"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (1.4ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:02:15.151667"], ["updated_at", "2015-07-27 09:02:15.151667"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:02:15.156653"], ["updated_at", "2015-07-27 09:02:15.156653"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:02:15.177629"], ["updated_at", "2015-07-27 09:02:15.177629"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:02:15.184800"], ["updated_at", "2015-07-27 09:02:15.184800"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:02:15.186568"], ["updated_at", "2015-07-27 09:02:15.186568"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:02:15.187852"], ["updated_at", "2015-07-27 09:02:15.187852"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:02:15.188992"], ["updated_at", "2015-07-27 09:02:15.188992"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:02:15.190155"], ["updated_at", "2015-07-27 09:02:15.190155"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:02:15.212742"], ["updated_at", "2015-07-27 09:02:15.212742"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:02:15.214498"], ["updated_at", "2015-07-27 09:02:15.214498"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:02:15.216465"], ["updated_at", "2015-07-27 09:02:15.216465"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:02:15.218381"], ["updated_at", "2015-07-27 09:02:15.218381"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:02:15.219527"], ["updated_at", "2015-07-27 09:02:15.219527"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.3ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (1.7ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:02:33.672225"], ["updated_at", "2015-07-27 09:02:33.672225"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:02:33.675161"], ["updated_at", "2015-07-27 09:02:33.675161"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:02:33.685075"], ["updated_at", "2015-07-27 09:02:33.685075"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:02:33.687166"], ["updated_at", "2015-07-27 09:02:33.687166"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:02:33.688310"], ["updated_at", "2015-07-27 09:02:33.688310"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.3ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (1.8ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:02:33.707233"], ["updated_at", "2015-07-27 09:02:33.707233"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:02:33.708723"], ["updated_at", "2015-07-27 09:02:33.708723"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:02:33.716612"], ["updated_at", "2015-07-27 09:02:33.716612"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:02:33.722956"], ["updated_at", "2015-07-27 09:02:33.722956"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:02:33.724493"], ["updated_at", "2015-07-27 09:02:33.724493"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:02:33.725673"], ["updated_at", "2015-07-27 09:02:33.725673"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:02:33.726774"], ["updated_at", "2015-07-27 09:02:33.726774"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:02:33.727848"], ["updated_at", "2015-07-27 09:02:33.727848"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY visits.place_id [["id", 1]]  (1.6ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:07:31.158537"], ["updated_at", "2015-07-27 09:07:31.158537"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:07:31.161798"], ["updated_at", "2015-07-27 09:07:31.161798"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:07:31.181418"], ["updated_at", "2015-07-27 09:07:31.181418"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:07:31.189195"], ["updated_at", "2015-07-27 09:07:31.189195"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:07:31.191024"], ["updated_at", "2015-07-27 09:07:31.191024"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:07:31.192328"], ["updated_at", "2015-07-27 09:07:31.192328"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:07:31.193460"], ["updated_at", "2015-07-27 09:07:31.193460"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:07:31.194794"], ["updated_at", "2015-07-27 09:07:31.194794"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY visits.place_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------- EagerCountingTest: test_count_by_a_distant_joined_model -------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:07:31.218028"], ["updated_at", "2015-07-27 09:07:31.218028"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:07:31.219484"], ["updated_at", "2015-07-27 09:07:31.219484"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:07:31.221303"], ["updated_at", "2015-07-27 09:07:31.221303"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:07:31.222663"], ["updated_at", "2015-07-27 09:07:31.222663"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:07:31.224249"], ["updated_at", "2015-07-27 09:07:31.224249"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:07:31.225472"], ["updated_at", "2015-07-27 09:07:31.225472"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:07:31.226579"], ["updated_at", "2015-07-27 09:07:31.226579"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:07:31.227678"], ["updated_at", "2015-07-27 09:07:31.227678"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 2], ["created_at", "2015-07-27 09:07:31.228825"], ["updated_at", "2015-07-27 09:07:31.228825"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 3], ["created_at", "2015-07-27 09:07:31.229953"], ["updated_at", "2015-07-27 09:07:31.229953"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:07:31.231062"], ["updated_at", "2015-07-27 09:07:31.231062"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY places.country_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:07:31.240954"], ["updated_at", "2015-07-27 09:07:31.240954"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:07:31.242200"], ["updated_at", "2015-07-27 09:07:31.242200"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:07:31.243884"], ["updated_at", "2015-07-27 09:07:31.243884"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:07:31.245180"], ["updated_at", "2015-07-27 09:07:31.245180"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:07:31.247667"], ["updated_at", "2015-07-27 09:07:31.247667"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (1.4ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.018825"], ["updated_at", "2015-07-27 09:15:46.018825"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.021733"], ["updated_at", "2015-07-27 09:15:46.021733"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:15:46.032084"], ["updated_at", "2015-07-27 09:15:46.032084"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:15:46.033683"], ["updated_at", "2015-07-27 09:15:46.033683"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:15:46.034795"], ["updated_at", "2015-07-27 09:15:46.034795"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------- EagerCountingTest: test_count_by_a_distant_joined_model -------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.057209"], ["updated_at", "2015-07-27 09:15:46.057209"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.060027"], ["updated_at", "2015-07-27 09:15:46.060027"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:15:46.068009"], ["updated_at", "2015-07-27 09:15:46.068009"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:15:46.069855"], ["updated_at", "2015-07-27 09:15:46.069855"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:15:46.074835"], ["updated_at", "2015-07-27 09:15:46.074835"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:15:46.076579"], ["updated_at", "2015-07-27 09:15:46.076579"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:15:46.077976"], ["updated_at", "2015-07-27 09:15:46.077976"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:15:46.079372"], ["updated_at", "2015-07-27 09:15:46.079372"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 2], ["created_at", "2015-07-27 09:15:46.080689"], ["updated_at", "2015-07-27 09:15:46.080689"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 3], ["created_at", "2015-07-27 09:15:46.082135"], ["updated_at", "2015-07-27 09:15:46.082135"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:15:46.083814"], ["updated_at", "2015-07-27 09:15:46.083814"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY places.country_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (1.7ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model ------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.099083"], ["updated_at", "2015-07-27 09:15:46.099083"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.100501"], ["updated_at", "2015-07-27 09:15:46.100501"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.101635"], ["updated_at", "2015-07-27 09:15:46.101635"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.102828"], ["updated_at", "2015-07-27 09:15:46.102828"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 1], ["created_at", "2015-07-27 09:15:46.105158"], ["updated_at", "2015-07-27 09:15:46.105158"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 2], ["created_at", "2015-07-27 09:15:46.106568"], ["updated_at", "2015-07-27 09:15:46.106568"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 2], ["product_id", 1], ["created_at", "2015-07-27 09:15:46.107680"], ["updated_at", "2015-07-27 09:15:46.107680"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.110751"], ["updated_at", "2015-07-27 09:15:46.110751"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:15:46.112438"], ["updated_at", "2015-07-27 09:15:46.112438"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:15:46.113916"], ["updated_at", "2015-07-27 09:15:46.113916"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:15:46.115294"], ["updated_at", "2015-07-27 09:15:46.115294"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:15:46.116682"], ["updated_at", "2015-07-27 09:15:46.116682"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:15:46.118070"], ["updated_at", "2015-07-27 09:15:46.118070"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:15:46.120068"], ["updated_at", "2015-07-27 09:15:46.120068"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:15:46.121537"], ["updated_at", "2015-07-27 09:15:46.121537"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY visits.place_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (1.5ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ------------------------------------------------------------------------ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model ------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.369914"], ["updated_at", "2015-07-27 09:16:06.369914"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.373816"], ["updated_at", "2015-07-27 09:16:06.373816"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.380943"], ["updated_at", "2015-07-27 09:16:06.380943"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.382220"], ["updated_at", "2015-07-27 09:16:06.382220"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 1], ["created_at", "2015-07-27 09:16:06.391755"], ["updated_at", "2015-07-27 09:16:06.391755"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 2], ["created_at", "2015-07-27 09:16:06.393401"], ["updated_at", "2015-07-27 09:16:06.393401"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 2], ["product_id", 1], ["created_at", "2015-07-27 09:16:06.394531"], ["updated_at", "2015-07-27 09:16:06.394531"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.404383"], ["updated_at", "2015-07-27 09:16:06.404383"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.408693"], ["updated_at", "2015-07-27 09:16:06.408693"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:16:06.413996"], ["updated_at", "2015-07-27 09:16:06.413996"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:16:06.416490"], ["updated_at", "2015-07-27 09:16:06.416490"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:16:06.417809"], ["updated_at", "2015-07-27 09:16:06.417809"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:16:06.418899"], ["updated_at", "2015-07-27 09:16:06.418899"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:16:06.419968"], ["updated_at", "2015-07-27 09:16:06.419968"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:16:06.421054"], ["updated_at", "2015-07-27 09:16:06.421054"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY visits.place_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------- EagerCountingTest: test_count_by_a_distant_joined_model -------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.441525"], ["updated_at", "2015-07-27 09:16:06.441525"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.443135"], ["updated_at", "2015-07-27 09:16:06.443135"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:16:06.445166"], ["updated_at", "2015-07-27 09:16:06.445166"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:16:06.446652"], ["updated_at", "2015-07-27 09:16:06.446652"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:16:06.448043"], ["updated_at", "2015-07-27 09:16:06.448043"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:16:06.449242"], ["updated_at", "2015-07-27 09:16:06.449242"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:16:06.451224"], ["updated_at", "2015-07-27 09:16:06.451224"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:16:06.452464"], ["updated_at", "2015-07-27 09:16:06.452464"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 2], ["created_at", "2015-07-27 09:16:06.453667"], ["updated_at", "2015-07-27 09:16:06.453667"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 3], ["created_at", "2015-07-27 09:16:06.454888"], ["updated_at", "2015-07-27 09:16:06.454888"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:16:06.456140"], ["updated_at", "2015-07-27 09:16:06.456140"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY places.country_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.466124"], ["updated_at", "2015-07-27 09:16:06.466124"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:16:06.467389"], ["updated_at", "2015-07-27 09:16:06.467389"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:16:06.469183"], ["updated_at", "2015-07-27 09:16:06.469183"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:16:06.470969"], ["updated_at", "2015-07-27 09:16:06.470969"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:16:06.473574"], ["updated_at", "2015-07-27 09:16:06.473574"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.4ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (1.3ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.209437"], ["updated_at", "2015-07-27 09:17:06.209437"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.213688"], ["updated_at", "2015-07-27 09:17:06.213688"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:17:06.226148"], ["updated_at", "2015-07-27 09:17:06.226148"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:17:06.228029"], ["updated_at", "2015-07-27 09:17:06.228029"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:17:06.229372"], ["updated_at", "2015-07-27 09:17:06.229372"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (1.3ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------- EagerCountingTest: test_count_by_a_distant_joined_model -------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.247678"], ["updated_at", "2015-07-27 09:17:06.247678"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.250642"], ["updated_at", "2015-07-27 09:17:06.250642"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:17:06.263968"], ["updated_at", "2015-07-27 09:17:06.263968"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:17:06.266044"], ["updated_at", "2015-07-27 09:17:06.266044"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:17:06.270727"], ["updated_at", "2015-07-27 09:17:06.270727"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:17:06.273286"], ["updated_at", "2015-07-27 09:17:06.273286"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:17:06.274908"], ["updated_at", "2015-07-27 09:17:06.274908"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:17:06.276393"], ["updated_at", "2015-07-27 09:17:06.276393"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 2], ["created_at", "2015-07-27 09:17:06.278116"], ["updated_at", "2015-07-27 09:17:06.278116"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 3], ["created_at", "2015-07-27 09:17:06.279774"], ["updated_at", "2015-07-27 09:17:06.279774"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:17:06.281215"], ["updated_at", "2015-07-27 09:17:06.281215"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY places.country_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (1.4ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.293642"], ["updated_at", "2015-07-27 09:17:06.293642"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.295052"], ["updated_at", "2015-07-27 09:17:06.295052"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:17:06.296474"], ["updated_at", "2015-07-27 09:17:06.296474"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:17:06.297881"], ["updated_at", "2015-07-27 09:17:06.297881"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:17:06.299463"], ["updated_at", "2015-07-27 09:17:06.299463"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:17:06.300818"], ["updated_at", "2015-07-27 09:17:06.300818"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:17:06.302005"], ["updated_at", "2015-07-27 09:17:06.302005"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:17:06.303788"], ["updated_at", "2015-07-27 09:17:06.303788"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY visits.place_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model ------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.313950"], ["updated_at", "2015-07-27 09:17:06.313950"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.315480"], ["updated_at", "2015-07-27 09:17:06.315480"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.316827"], ["updated_at", "2015-07-27 09:17:06.316827"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:17:06.317868"], ["updated_at", "2015-07-27 09:17:06.317868"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 1], ["created_at", "2015-07-27 09:17:06.320241"], ["updated_at", "2015-07-27 09:17:06.320241"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 2], ["created_at", "2015-07-27 09:17:06.321765"], ["updated_at", "2015-07-27 09:17:06.321765"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 2], ["product_id", 1], ["created_at", "2015-07-27 09:17:06.322967"], ["updated_at", "2015-07-27 09:17:06.322967"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (0.2ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products" WHERE "products"."id" = ?) GROUP BY actions.product_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (1.6ms) rollback transaction ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ------------------------------------------------------------------------ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model ------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.466195"], ["updated_at", "2015-07-27 09:29:15.466195"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.469363"], ["updated_at", "2015-07-27 09:29:15.469363"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.476530"], ["updated_at", "2015-07-27 09:29:15.476530"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.478105"], ["updated_at", "2015-07-27 09:29:15.478105"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 1], ["created_at", "2015-07-27 09:29:15.487665"], ["updated_at", "2015-07-27 09:29:15.487665"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 2], ["created_at", "2015-07-27 09:29:15.489111"], ["updated_at", "2015-07-27 09:29:15.489111"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 2], ["product_id", 1], ["created_at", "2015-07-27 09:29:15.490446"], ["updated_at", "2015-07-27 09:29:15.490446"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (0.2ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products" WHERE "products"."id" = ?) GROUP BY actions.product_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (1.3ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------- EagerCountingTest: test_count_by_a_distant_joined_model -------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.516420"], ["updated_at", "2015-07-27 09:29:15.516420"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.520009"], ["updated_at", "2015-07-27 09:29:15.520009"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:29:15.527462"], ["updated_at", "2015-07-27 09:29:15.527462"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:29:15.529400"], ["updated_at", "2015-07-27 09:29:15.529400"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:29:15.530779"], ["updated_at", "2015-07-27 09:29:15.530779"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:29:15.532279"], ["updated_at", "2015-07-27 09:29:15.532279"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:29:15.534203"], ["updated_at", "2015-07-27 09:29:15.534203"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:29:15.535497"], ["updated_at", "2015-07-27 09:29:15.535497"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 2], ["created_at", "2015-07-27 09:29:15.536556"], ["updated_at", "2015-07-27 09:29:15.536556"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 3], ["created_at", "2015-07-27 09:29:15.537661"], ["updated_at", "2015-07-27 09:29:15.537661"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:29:15.538720"], ["updated_at", "2015-07-27 09:29:15.538720"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY places.country_id [["id", 1]]  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.550545"], ["updated_at", "2015-07-27 09:29:15.550545"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.553556"], ["updated_at", "2015-07-27 09:29:15.553556"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:29:15.556138"], ["updated_at", "2015-07-27 09:29:15.556138"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:29:15.557489"], ["updated_at", "2015-07-27 09:29:15.557489"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:29:15.558595"], ["updated_at", "2015-07-27 09:29:15.558595"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (0.2ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.565296"], ["updated_at", "2015-07-27 09:29:15.565296"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.566828"], ["updated_at", "2015-07-27 09:29:15.566828"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:29:15.568397"], ["updated_at", "2015-07-27 09:29:15.568397"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:29:15.569630"], ["updated_at", "2015-07-27 09:29:15.569630"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:29:15.570814"], ["updated_at", "2015-07-27 09:29:15.570814"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:29:15.571959"], ["updated_at", "2015-07-27 09:29:15.571959"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:29:15.573183"], ["updated_at", "2015-07-27 09:29:15.573183"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:29:15.574680"], ["updated_at", "2015-07-27 09:29:15.574680"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.4ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY visits.place_id [["id", 1]]  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (1.5ms) rollback transaction  (0.2ms) begin transaction --------------------------------------------------------------- EagerCountingTest: test_count_by_polymorphicly_associated_model ---------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.585744"], ["updated_at", "2015-07-27 09:29:15.585744"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:15.590782"], ["updated_at", "2015-07-27 09:29:15.590782"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:35.906498"], ["updated_at", "2015-07-27 09:29:35.906498"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:35.910140"], ["updated_at", "2015-07-27 09:29:35.910140"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:29:35.925226"], ["updated_at", "2015-07-27 09:29:35.925226"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:29:35.926707"], ["updated_at", "2015-07-27 09:29:35.926707"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:29:35.927756"], ["updated_at", "2015-07-27 09:29:35.927756"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------- EagerCountingTest: test_count_by_a_distant_joined_model -------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:35.945159"], ["updated_at", "2015-07-27 09:29:35.945159"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:35.947913"], ["updated_at", "2015-07-27 09:29:35.947913"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:29:35.959769"], ["updated_at", "2015-07-27 09:29:35.959769"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:29:35.961668"], ["updated_at", "2015-07-27 09:29:35.961668"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:29:35.965878"], ["updated_at", "2015-07-27 09:29:35.965878"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:29:35.967272"], ["updated_at", "2015-07-27 09:29:35.967272"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:29:35.968587"], ["updated_at", "2015-07-27 09:29:35.968587"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:29:35.969881"], ["updated_at", "2015-07-27 09:29:35.969881"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 2], ["created_at", "2015-07-27 09:29:35.970976"], ["updated_at", "2015-07-27 09:29:35.970976"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 3], ["created_at", "2015-07-27 09:29:35.972059"], ["updated_at", "2015-07-27 09:29:35.972059"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:29:35.973127"], ["updated_at", "2015-07-27 09:29:35.973127"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (0.4ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY places.country_id [["id", 1]]  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model ------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:35.987694"], ["updated_at", "2015-07-27 09:29:35.987694"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:35.989026"], ["updated_at", "2015-07-27 09:29:35.989026"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:35.990319"], ["updated_at", "2015-07-27 09:29:35.990319"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:35.991447"], ["updated_at", "2015-07-27 09:29:35.991447"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 1], ["created_at", "2015-07-27 09:29:35.993087"], ["updated_at", "2015-07-27 09:29:35.993087"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 2], ["created_at", "2015-07-27 09:29:35.994770"], ["updated_at", "2015-07-27 09:29:35.994770"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 2], ["product_id", 1], ["created_at", "2015-07-27 09:29:35.995909"], ["updated_at", "2015-07-27 09:29:35.995909"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (0.2ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products" WHERE "products"."id" = ?) GROUP BY actions.product_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:36.002645"], ["updated_at", "2015-07-27 09:29:36.002645"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:36.004122"], ["updated_at", "2015-07-27 09:29:36.004122"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:29:36.005732"], ["updated_at", "2015-07-27 09:29:36.005732"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:29:36.006921"], ["updated_at", "2015-07-27 09:29:36.006921"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:29:36.008010"], ["updated_at", "2015-07-27 09:29:36.008010"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:29:36.009061"], ["updated_at", "2015-07-27 09:29:36.009061"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:29:36.010107"], ["updated_at", "2015-07-27 09:29:36.010107"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:29:36.011129"], ["updated_at", "2015-07-27 09:29:36.011129"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.3ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY visits.place_id [["id", 1]]  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (2.0ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- EagerCountingTest: test_count_by_polymorphicly_associated_model ---------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:36.020239"], ["updated_at", "2015-07-27 09:29:36.020239"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:36.021648"], ["updated_at", "2015-07-27 09:29:36.021648"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 1], ["commentable_type", "Place"], ["created_at", "2015-07-27 09:29:36.032533"], ["updated_at", "2015-07-27 09:29:36.032533"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 1], ["commentable_type", "Place"], ["created_at", "2015-07-27 09:29:36.034092"], ["updated_at", "2015-07-27 09:29:36.034092"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 2], ["commentable_type", "Place"], ["created_at", "2015-07-27 09:29:36.035466"], ["updated_at", "2015-07-27 09:29:36.035466"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ------------------------------------------------------------------------ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model ------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.403050"], ["updated_at", "2015-07-27 09:29:57.403050"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.406276"], ["updated_at", "2015-07-27 09:29:57.406276"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.413165"], ["updated_at", "2015-07-27 09:29:57.413165"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.414436"], ["updated_at", "2015-07-27 09:29:57.414436"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 1], ["created_at", "2015-07-27 09:29:57.424067"], ["updated_at", "2015-07-27 09:29:57.424067"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 2], ["created_at", "2015-07-27 09:29:57.425609"], ["updated_at", "2015-07-27 09:29:57.425609"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 2], ["product_id", 1], ["created_at", "2015-07-27 09:29:57.426729"], ["updated_at", "2015-07-27 09:29:57.426729"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (0.4ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products" WHERE "products"."id" = ?) GROUP BY actions.product_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.454691"], ["updated_at", "2015-07-27 09:29:57.454691"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.456115"], ["updated_at", "2015-07-27 09:29:57.456115"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:29:57.458038"], ["updated_at", "2015-07-27 09:29:57.458038"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 09:29:57.459326"], ["updated_at", "2015-07-27 09:29:57.459326"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 09:29:57.460836"], ["updated_at", "2015-07-27 09:29:57.460836"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.471392"], ["updated_at", "2015-07-27 09:29:57.471392"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.472851"], ["updated_at", "2015-07-27 09:29:57.472851"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:29:57.474590"], ["updated_at", "2015-07-27 09:29:57.474590"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:29:57.476463"], ["updated_at", "2015-07-27 09:29:57.476463"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:29:57.478753"], ["updated_at", "2015-07-27 09:29:57.478753"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:29:57.480314"], ["updated_at", "2015-07-27 09:29:57.480314"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:29:57.481516"], ["updated_at", "2015-07-27 09:29:57.481516"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:29:57.482790"], ["updated_at", "2015-07-27 09:29:57.482790"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.5ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY visits.place_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------- EagerCountingTest: test_count_by_a_distant_joined_model -------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.496812"], ["updated_at", "2015-07-27 09:29:57.496812"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.498077"], ["updated_at", "2015-07-27 09:29:57.498077"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:29:57.499841"], ["updated_at", "2015-07-27 09:29:57.499841"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 09:29:57.501229"], ["updated_at", "2015-07-27 09:29:57.501229"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 09:29:57.502434"], ["updated_at", "2015-07-27 09:29:57.502434"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 09:29:57.504099"], ["updated_at", "2015-07-27 09:29:57.504099"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 09:29:57.505414"], ["updated_at", "2015-07-27 09:29:57.505414"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 09:29:57.506578"], ["updated_at", "2015-07-27 09:29:57.506578"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 2], ["created_at", "2015-07-27 09:29:57.507683"], ["updated_at", "2015-07-27 09:29:57.507683"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 3], ["created_at", "2015-07-27 09:29:57.508743"], ["updated_at", "2015-07-27 09:29:57.508743"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 09:29:57.509829"], ["updated_at", "2015-07-27 09:29:57.509829"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY places.country_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (1.5ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- EagerCountingTest: test_count_by_polymorphicly_associated_model ---------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.516858"], ["updated_at", "2015-07-27 09:29:57.516858"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 09:29:57.519037"], ["updated_at", "2015-07-27 09:29:57.519037"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 1], ["commentable_type", "Place"], ["created_at", "2015-07-27 09:29:57.525911"], ["updated_at", "2015-07-27 09:29:57.525911"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 1], ["commentable_type", "Place"], ["created_at", "2015-07-27 09:29:57.528121"], ["updated_at", "2015-07-27 09:29:57.528121"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 2], ["commentable_type", "Place"], ["created_at", "2015-07-27 09:29:57.529822"], ["updated_at", "2015-07-27 09:29:57.529822"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, comments.commentable_id AS comments_commentable_id FROM "comments" WHERE "comments"."commentable_type" = 'Place' AND "comments"."commentable_id" IN (SELECT "places"."id" FROM "places") GROUP BY comments.commentable_id  (0.3ms) SELECT COUNT(*) AS count_all, comments.commentable_id AS comments_commentable_id FROM "comments" WHERE "comments"."commentable_type" = 'Place' AND "comments"."commentable_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY comments.commentable_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, comments.commentable_id AS comments_commentable_id FROM "comments" WHERE "comments"."commentable_type" = 'Place' AND "comments"."commentable_id" IN (SELECT "places"."id" FROM "places") GROUP BY comments.commentable_id  (1.5ms) rollback transaction  (0.3ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (4.0ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "visits" ("created_at", "updated_at", "user_id") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["user_id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at", "user_id") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["user_id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "updated_at", "user_id") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["user_id", 2]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.6ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------- EagerCountingTest: test_count_by_a_distant_joined_model -------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "place_id", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["place_id", 1], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "actions" ("created_at", "updated_at", "visit_id") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["visit_id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "place_id", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["place_id", 2], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("created_at", "updated_at", "visit_id") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["visit_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 2], ["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "place_id", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["place_id", 3], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("created_at", "updated_at", "visit_id") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["visit_id", 3]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) rollback transaction  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "place_id", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["place_id", 1], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("created_at", "updated_at", "visit_id") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["visit_id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "place_id", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["place_id", 1], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("created_at", "updated_at", "visit_id") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["visit_id", 2]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "visits" ("created_at", "place_id", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["place_id", 2], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("created_at", "updated_at", "visit_id") VALUES (?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["visit_id", 3]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model ------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "actions" ("created_at", "product_id", "updated_at", "visit_id") VALUES (?, ?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["visit_id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("created_at", "product_id", "updated_at", "visit_id") VALUES (?, ?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["product_id", 2], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["visit_id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("created_at", "product_id", "updated_at", "visit_id") VALUES (?, ?, ?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["product_id", 1], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["visit_id", 2]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.4ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- EagerCountingTest: test_count_by_polymorphicly_associated_model ---------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 1], ["commentable_type", "Place"], ["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 1], ["commentable_type", "Place"], ["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 2], ["commentable_type", "Place"], ["created_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00], ["updated_at", Mon, 27 Jul 2015 11:22:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.5ms) rollback transaction ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.1ms) begin transaction ----------------------------------------------- EagerCountingTest: test_count_by_a_joined_model -----------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.851387"], ["updated_at", "2015-07-27 11:27:07.851387"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.856127"], ["updated_at", "2015-07-27 11:27:07.856127"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 11:27:07.870990"], ["updated_at", "2015-07-27 11:27:07.870990"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 11:27:07.880616"], ["updated_at", "2015-07-27 11:27:07.880616"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 11:27:07.882416"], ["updated_at", "2015-07-27 11:27:07.882416"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 11:27:07.884161"], ["updated_at", "2015-07-27 11:27:07.884161"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 11:27:07.886996"], ["updated_at", "2015-07-27 11:27:07.886996"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 11:27:07.891327"], ["updated_at", "2015-07-27 11:27:07.891327"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY visits.place_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.place_id AS visits_place_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" WHERE "visits"."place_id" IN (SELECT "places"."id" FROM "places") GROUP BY visits.place_id  (1.5ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------- EagerCountingTest: test_count_by_a_distant_joined_model -------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.916126"], ["updated_at", "2015-07-27 11:27:07.916126"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "countries" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.917688"], ["updated_at", "2015-07-27 11:27:07.917688"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 11:27:07.920747"], ["updated_at", "2015-07-27 11:27:07.920747"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 1], ["created_at", "2015-07-27 11:27:07.922745"], ["updated_at", "2015-07-27 11:27:07.922745"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 1], ["created_at", "2015-07-27 11:27:07.924460"], ["updated_at", "2015-07-27 11:27:07.924460"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 1], ["created_at", "2015-07-27 11:27:07.925922"], ["updated_at", "2015-07-27 11:27:07.925922"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 2], ["created_at", "2015-07-27 11:27:07.927209"], ["updated_at", "2015-07-27 11:27:07.927209"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 2], ["created_at", "2015-07-27 11:27:07.928558"], ["updated_at", "2015-07-27 11:27:07.928558"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.0ms) INSERT INTO "places" ("country_id", "created_at", "updated_at") VALUES (?, ?, ?) [["country_id", 2], ["created_at", "2015-07-27 11:27:07.929857"], ["updated_at", "2015-07-27 11:27:07.929857"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("place_id", "created_at", "updated_at") VALUES (?, ?, ?) [["place_id", 3], ["created_at", "2015-07-27 11:27:07.931058"], ["updated_at", "2015-07-27 11:27:07.931058"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "created_at", "updated_at") VALUES (?, ?, ?) [["visit_id", 3], ["created_at", "2015-07-27 11:27:07.932264"], ["updated_at", "2015-07-27 11:27:07.932264"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (0.2ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY places.country_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, places.country_id AS places_country_id FROM "actions" INNER JOIN "visits" ON "visits"."id" = "actions"."visit_id" INNER JOIN "places" ON "places"."id" = "visits"."place_id" WHERE "places"."country_id" IN (SELECT "countries"."id" FROM "countries") GROUP BY places.country_id  (1.5ms) rollback transaction  (0.1ms) begin transaction --------------------------------------------------------------- EagerCountingTest: test_count_by_polymorphicly_associated_model ---------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.939699"], ["updated_at", "2015-07-27 11:27:07.939699"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "places" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.941251"], ["updated_at", "2015-07-27 11:27:07.941251"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 1], ["commentable_type", "Place"], ["created_at", "2015-07-27 11:27:07.947335"], ["updated_at", "2015-07-27 11:27:07.947335"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 1], ["commentable_type", "Place"], ["created_at", "2015-07-27 11:27:07.949287"], ["updated_at", "2015-07-27 11:27:07.949287"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "comments" ("commentable_id", "commentable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["commentable_id", 2], ["commentable_type", "Place"], ["created_at", "2015-07-27 11:27:07.950515"], ["updated_at", "2015-07-27 11:27:07.950515"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, comments.commentable_id AS comments_commentable_id FROM "comments" WHERE "comments"."commentable_type" = 'Place' AND "comments"."commentable_id" IN (SELECT "places"."id" FROM "places") GROUP BY comments.commentable_id  (0.2ms) SELECT COUNT(*) AS count_all, comments.commentable_id AS comments_commentable_id FROM "comments" WHERE "comments"."commentable_type" = 'Place' AND "comments"."commentable_id" IN (SELECT "places"."id" FROM "places" WHERE "places"."id" = ?) GROUP BY comments.commentable_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, comments.commentable_id AS comments_commentable_id FROM "comments" WHERE "comments"."commentable_type" = 'Place' AND "comments"."commentable_id" IN (SELECT "places"."id" FROM "places") GROUP BY comments.commentable_id  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------------------ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model ------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.963792"], ["updated_at", "2015-07-27 11:27:07.963792"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.965275"], ["updated_at", "2015-07-27 11:27:07.965275"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.966565"], ["updated_at", "2015-07-27 11:27:07.966565"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.967772"], ["updated_at", "2015-07-27 11:27:07.967772"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 1], ["created_at", "2015-07-27 11:27:07.970386"], ["updated_at", "2015-07-27 11:27:07.970386"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 1], ["product_id", 2], ["created_at", "2015-07-27 11:27:07.972734"], ["updated_at", "2015-07-27 11:27:07.972734"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "actions" ("visit_id", "product_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["visit_id", 2], ["product_id", 1], ["created_at", "2015-07-27 11:27:07.974211"], ["updated_at", "2015-07-27 11:27:07.974211"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (0.3ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products" WHERE "products"."id" = ?) GROUP BY actions.product_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, actions.product_id AS actions_product_id FROM "visits" INNER JOIN "actions" ON "actions"."visit_id" = "visits"."id" WHERE "actions"."product_id" IN (SELECT "products"."id" FROM "products") GROUP BY actions.product_id  (1.4ms) rollback transaction  (0.1ms) begin transaction ------------------------------------------------------------ EagerCountingTest: test_count_by_a_directly_associated_model ------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.986004"], ["updated_at", "2015-07-27 11:27:07.986004"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-27 11:27:07.987411"], ["updated_at", "2015-07-27 11:27:07.987411"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 11:27:07.989960"], ["updated_at", "2015-07-27 11:27:07.989960"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 1], ["created_at", "2015-07-27 11:27:07.991405"], ["updated_at", "2015-07-27 11:27:07.991405"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "visits" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", "2015-07-27 11:27:07.993176"], ["updated_at", "2015-07-27 11:27:07.993176"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (0.2ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users" WHERE "users"."id" = ?) GROUP BY visits.user_id [["id", 1]]  (0.1ms) SELECT COUNT(*) AS count_all, visits.user_id AS visits_user_id FROM "visits" WHERE "visits"."user_id" IN (SELECT "users"."id" FROM "users") GROUP BY visits.user_id  (1.5ms) rollback transaction