eager_counting 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +80 -0
  4. data/Rakefile +34 -0
  5. data/lib/eager_counting.rb +4 -0
  6. data/lib/eager_counting/count_by.rb +87 -0
  7. data/lib/eager_counting/version.rb +3 -0
  8. data/test/dummy/README.rdoc +28 -0
  9. data/test/dummy/Rakefile +6 -0
  10. data/test/dummy/app/assets/javascripts/application.js +13 -0
  11. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  12. data/test/dummy/app/controllers/application_controller.rb +5 -0
  13. data/test/dummy/app/helpers/application_helper.rb +2 -0
  14. data/test/dummy/app/models/action.rb +6 -0
  15. data/test/dummy/app/models/comment.rb +5 -0
  16. data/test/dummy/app/models/country.rb +3 -0
  17. data/test/dummy/app/models/place.rb +6 -0
  18. data/test/dummy/app/models/product.rb +3 -0
  19. data/test/dummy/app/models/user.rb +3 -0
  20. data/test/dummy/app/models/visit.rb +8 -0
  21. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  22. data/test/dummy/bin/bundle +3 -0
  23. data/test/dummy/bin/rails +4 -0
  24. data/test/dummy/bin/rake +4 -0
  25. data/test/dummy/bin/setup +29 -0
  26. data/test/dummy/config.ru +4 -0
  27. data/test/dummy/config/application.rb +26 -0
  28. data/test/dummy/config/boot.rb +5 -0
  29. data/test/dummy/config/database.yml +25 -0
  30. data/test/dummy/config/environment.rb +5 -0
  31. data/test/dummy/config/environments/development.rb +41 -0
  32. data/test/dummy/config/environments/production.rb +79 -0
  33. data/test/dummy/config/environments/test.rb +42 -0
  34. data/test/dummy/config/initializers/assets.rb +11 -0
  35. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  36. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  37. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  38. data/test/dummy/config/initializers/inflections.rb +16 -0
  39. data/test/dummy/config/initializers/mime_types.rb +4 -0
  40. data/test/dummy/config/initializers/session_store.rb +3 -0
  41. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  42. data/test/dummy/config/locales/en.yml +23 -0
  43. data/test/dummy/config/routes.rb +56 -0
  44. data/test/dummy/config/secrets.yml +22 -0
  45. data/test/dummy/db/development.sqlite3 +0 -0
  46. data/test/dummy/db/migrate/20150727081137_create_users.rb +8 -0
  47. data/test/dummy/db/migrate/20150727081314_create_countries.rb +8 -0
  48. data/test/dummy/db/migrate/20150727081755_create_places.rb +9 -0
  49. data/test/dummy/db/migrate/20150727081827_create_visits.rb +10 -0
  50. data/test/dummy/db/migrate/20150727081904_create_products.rb +8 -0
  51. data/test/dummy/db/migrate/20150727081905_create_actions.rb +10 -0
  52. data/test/dummy/db/migrate/20150727082016_create_comments.rb +9 -0
  53. data/test/dummy/db/schema.rb +68 -0
  54. data/test/dummy/db/test.sqlite3 +0 -0
  55. data/test/dummy/log/development.log +110 -0
  56. data/test/dummy/log/test.log +1437 -0
  57. data/test/dummy/public/404.html +67 -0
  58. data/test/dummy/public/422.html +67 -0
  59. data/test/dummy/public/500.html +66 -0
  60. data/test/dummy/public/favicon.ico +0 -0
  61. data/test/dummy/test/models/action_test.rb +7 -0
  62. data/test/dummy/test/models/comment_test.rb +7 -0
  63. data/test/dummy/test/models/country_test.rb +7 -0
  64. data/test/dummy/test/models/place_test.rb +7 -0
  65. data/test/dummy/test/models/product_test.rb +7 -0
  66. data/test/dummy/test/models/visit_test.rb +7 -0
  67. data/test/eager_counting_test.rb +85 -0
  68. data/test/test_helper.rb +19 -0
  69. metadata +257 -0
@@ -0,0 +1,10 @@
1
+ class CreateVisits < ActiveRecord::Migration
2
+ def change
3
+ create_table :visits do |t|
4
+ t.references :place, index: true, foreign_key: true
5
+ t.references :user, index: true, foreign_key: true
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ class CreateProducts < ActiveRecord::Migration
2
+ def change
3
+ create_table :products do |t|
4
+
5
+ t.timestamps null: false
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ class CreateActions < ActiveRecord::Migration
2
+ def change
3
+ create_table :actions do |t|
4
+ t.references :visit, index: true, foreign_key: true
5
+ t.references :product, index: true, foreign_key: true
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ class CreateComments < ActiveRecord::Migration
2
+ def change
3
+ create_table :comments do |t|
4
+ t.references :commentable, polymorphic: true, index: true
5
+
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,68 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20150727082016) do
15
+
16
+ create_table "actions", force: :cascade do |t|
17
+ t.integer "visit_id"
18
+ t.integer "product_id"
19
+ t.datetime "created_at", null: false
20
+ t.datetime "updated_at", null: false
21
+ end
22
+
23
+ add_index "actions", ["product_id"], name: "index_actions_on_product_id"
24
+ add_index "actions", ["visit_id"], name: "index_actions_on_visit_id"
25
+
26
+ create_table "comments", force: :cascade do |t|
27
+ t.integer "commentable_id"
28
+ t.string "commentable_type"
29
+ t.datetime "created_at", null: false
30
+ t.datetime "updated_at", null: false
31
+ end
32
+
33
+ add_index "comments", ["commentable_type", "commentable_id"], name: "index_comments_on_commentable_type_and_commentable_id"
34
+
35
+ create_table "countries", force: :cascade do |t|
36
+ t.datetime "created_at", null: false
37
+ t.datetime "updated_at", null: false
38
+ end
39
+
40
+ create_table "places", force: :cascade do |t|
41
+ t.integer "country_id"
42
+ t.datetime "created_at", null: false
43
+ t.datetime "updated_at", null: false
44
+ end
45
+
46
+ add_index "places", ["country_id"], name: "index_places_on_country_id"
47
+
48
+ create_table "products", force: :cascade do |t|
49
+ t.datetime "created_at", null: false
50
+ t.datetime "updated_at", null: false
51
+ end
52
+
53
+ create_table "users", force: :cascade do |t|
54
+ t.datetime "created_at", null: false
55
+ t.datetime "updated_at", null: false
56
+ end
57
+
58
+ create_table "visits", force: :cascade do |t|
59
+ t.integer "place_id"
60
+ t.integer "user_id"
61
+ t.datetime "created_at", null: false
62
+ t.datetime "updated_at", null: false
63
+ end
64
+
65
+ add_index "visits", ["place_id"], name: "index_visits_on_place_id"
66
+ add_index "visits", ["user_id"], name: "index_visits_on_user_id"
67
+
68
+ end
Binary file
@@ -0,0 +1,110 @@
1
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreateUsers (20150727081137)
6
+  (0.1ms) begin transaction
7
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
8
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150727081137"]]
9
+  (1.6ms) commit transaction
10
+ Migrating to CreateCountries (20150727081314)
11
+  (0.1ms) begin transaction
12
+  (0.4ms) CREATE TABLE "countries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
13
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150727081314"]]
14
+  (1.4ms) commit transaction
15
+ Migrating to CreatePlaces (20150727081755)
16
+  (0.1ms) begin transaction
17
+  (0.4ms) CREATE TABLE "places" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "country_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
18
+  (0.1ms) CREATE INDEX "index_places_on_country_id" ON "places" ("country_id")
19
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150727081755"]]
20
+  (1.4ms) commit transaction
21
+ Migrating to CreateVisits (20150727081827)
22
+  (0.1ms) begin transaction
23
+  (0.3ms) 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) 
24
+  (0.2ms) CREATE INDEX "index_visits_on_place_id" ON "visits" ("place_id")
25
+  (0.1ms)  SELECT sql
26
+ FROM sqlite_master
27
+ WHERE name='index_visits_on_place_id' AND type='index'
28
+ UNION ALL
29
+ SELECT sql
30
+ FROM sqlite_temp_master
31
+ WHERE name='index_visits_on_place_id' AND type='index'
32
+ 
33
+  (0.1ms) CREATE INDEX "index_visits_on_user_id" ON "visits" ("user_id")
34
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150727081827"]]
35
+  (1.5ms) commit transaction
36
+ Migrating to CreateProducts (20150727081904)
37
+  (0.1ms) begin transaction
38
+  (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
39
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150727081904"]]
40
+  (1.7ms) commit transaction
41
+ Migrating to CreateActions (20150727081905)
42
+  (0.1ms) begin transaction
43
+  (0.8ms) 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)
44
+  (0.1ms) CREATE INDEX "index_actions_on_visit_id" ON "actions" ("visit_id")
45
+  (0.1ms) SELECT sql
46
+ FROM sqlite_master
47
+ WHERE name='index_actions_on_visit_id' AND type='index'
48
+ UNION ALL
49
+ SELECT sql
50
+ FROM sqlite_temp_master
51
+ WHERE name='index_actions_on_visit_id' AND type='index'
52
+
53
+  (0.1ms) CREATE INDEX "index_actions_on_product_id" ON "actions" ("product_id")
54
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150727081905"]]
55
+  (1.4ms) commit transaction
56
+ Migrating to CreateComments (20150727082016)
57
+  (0.1ms) begin transaction
58
+  (0.4ms) 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) 
59
+  (0.2ms) CREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")
60
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150727082016"]]
61
+  (1.4ms) commit transaction
62
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
63
+  (0.1ms) SELECT sql
64
+ FROM sqlite_master
65
+ WHERE name='index_actions_on_product_id' AND type='index'
66
+ UNION ALL
67
+ SELECT sql
68
+ FROM sqlite_temp_master
69
+ WHERE name='index_actions_on_product_id' AND type='index'
70
+
71
+  (0.1ms)  SELECT sql
72
+ FROM sqlite_master
73
+ WHERE name='index_actions_on_visit_id' AND type='index'
74
+ UNION ALL
75
+ SELECT sql
76
+ FROM sqlite_temp_master
77
+ WHERE name='index_actions_on_visit_id' AND type='index'
78
+ 
79
+  (0.1ms) SELECT sql
80
+ FROM sqlite_master
81
+ WHERE name='index_comments_on_commentable_type_and_commentable_id' AND type='index'
82
+ UNION ALL
83
+ SELECT sql
84
+ FROM sqlite_temp_master
85
+ WHERE name='index_comments_on_commentable_type_and_commentable_id' AND type='index'
86
+
87
+  (0.1ms)  SELECT sql
88
+ FROM sqlite_master
89
+ WHERE name='index_places_on_country_id' AND type='index'
90
+ UNION ALL
91
+ SELECT sql
92
+ FROM sqlite_temp_master
93
+ WHERE name='index_places_on_country_id' AND type='index'
94
+ 
95
+  (0.1ms) SELECT sql
96
+ FROM sqlite_master
97
+ WHERE name='index_visits_on_user_id' AND type='index'
98
+ UNION ALL
99
+ SELECT sql
100
+ FROM sqlite_temp_master
101
+ WHERE name='index_visits_on_user_id' AND type='index'
102
+
103
+  (0.1ms)  SELECT sql
104
+ FROM sqlite_master
105
+ WHERE name='index_visits_on_place_id' AND type='index'
106
+ UNION ALL
107
+ SELECT sql
108
+ FROM sqlite_temp_master
109
+ WHERE name='index_visits_on_place_id' AND type='index'
110
+ 
@@ -0,0 +1,1437 @@
1
+  (0.1ms) begin transaction
2
+ -----------------------------
3
+ EagerCountingTest: test_truth
4
+ -----------------------------
5
+  (0.0ms) rollback transaction
6
+  (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) 
7
+  (0.1ms) select sqlite_version(*)
8
+  (1.6ms) CREATE INDEX "index_actions_on_product_id" ON "actions" ("product_id")
9
+  (0.1ms) SELECT sql
10
+ FROM sqlite_master
11
+ WHERE name='index_actions_on_product_id' AND type='index'
12
+ UNION ALL
13
+ SELECT sql
14
+ FROM sqlite_temp_master
15
+ WHERE name='index_actions_on_product_id' AND type='index'
16
+
17
+  (1.4ms) CREATE INDEX "index_actions_on_visit_id" ON "actions" ("visit_id")
18
+  (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)
19
+  (1.5ms) CREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")
20
+  (1.9ms) CREATE TABLE "countries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
21
+  (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) 
22
+  (1.5ms) CREATE INDEX "index_places_on_country_id" ON "places" ("country_id")
23
+  (1.9ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
24
+  (1.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
25
+  (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) 
26
+  (1.5ms) CREATE INDEX "index_visits_on_place_id" ON "visits" ("place_id")
27
+  (0.1ms)  SELECT sql
28
+ FROM sqlite_master
29
+ WHERE name='index_visits_on_place_id' AND type='index'
30
+ UNION ALL
31
+ SELECT sql
32
+ FROM sqlite_temp_master
33
+ WHERE name='index_visits_on_place_id' AND type='index'
34
+ 
35
+  (2.0ms) CREATE INDEX "index_visits_on_user_id" ON "visits" ("user_id")
36
+  (2.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
37
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
38
+  (0.1ms) SELECT version FROM "schema_migrations"
39
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727082016')
40
+  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081137')
41
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081314')
42
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081755')
43
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081827')
44
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081904')
45
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150727081905')
46
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
47
+  (0.1ms) begin transaction
48
+ ------------------------------------------------------------
49
+ EagerCountingTest: test_count_by_a_directly_associated_model
50
+ ------------------------------------------------------------
51
+  (0.1ms) SAVEPOINT active_record_1
52
+ 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"]]
53
+  (0.0ms) RELEASE SAVEPOINT active_record_1
54
+  (0.0ms) SAVEPOINT active_record_1
55
+ 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"]]
56
+  (0.0ms) RELEASE SAVEPOINT active_record_1
57
+  (0.1ms) SAVEPOINT active_record_1
58
+ 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"]]
59
+  (0.1ms) RELEASE SAVEPOINT active_record_1
60
+  (0.0ms) SAVEPOINT active_record_1
61
+ 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"]]
62
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63
+  (0.0ms) SAVEPOINT active_record_1
64
+ 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"]]
65
+  (0.0ms) RELEASE SAVEPOINT active_record_1
66
+  (1.6ms) rollback transaction
67
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
68
+  (0.1ms) begin transaction
69
+ ------------------------------------------------------------
70
+ EagerCountingTest: test_count_by_a_directly_associated_model
71
+ ------------------------------------------------------------
72
+  (0.0ms) SAVEPOINT active_record_1
73
+ 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"]]
74
+  (0.0ms) RELEASE SAVEPOINT active_record_1
75
+  (0.0ms) SAVEPOINT active_record_1
76
+ 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"]]
77
+  (0.0ms) RELEASE SAVEPOINT active_record_1
78
+  (0.1ms) SAVEPOINT active_record_1
79
+ 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"]]
80
+  (0.0ms) RELEASE SAVEPOINT active_record_1
81
+  (0.0ms) SAVEPOINT active_record_1
82
+ 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"]]
83
+  (0.0ms) RELEASE SAVEPOINT active_record_1
84
+  (0.0ms) SAVEPOINT active_record_1
85
+ 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"]]
86
+  (0.0ms) RELEASE SAVEPOINT active_record_1
87
+  (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
88
+  (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
89
+  (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]]
90
+  (1.3ms) rollback transaction
91
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
92
+  (0.1ms) begin transaction
93
+ -----------------------------------------------
94
+ EagerCountingTest: test_count_by_a_joined_model
95
+ -----------------------------------------------
96
+  (0.1ms) SAVEPOINT active_record_1
97
+ 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"]]
98
+  (0.1ms) RELEASE SAVEPOINT active_record_1
99
+  (0.0ms) SAVEPOINT active_record_1
100
+ 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"]]
101
+  (0.0ms) RELEASE SAVEPOINT active_record_1
102
+  (0.1ms) SAVEPOINT active_record_1
103
+ 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"]]
104
+  (0.0ms) RELEASE SAVEPOINT active_record_1
105
+  (0.1ms) SAVEPOINT active_record_1
106
+ 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"]]
107
+  (0.0ms) RELEASE SAVEPOINT active_record_1
108
+  (0.0ms) SAVEPOINT active_record_1
109
+ 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"]]
110
+  (0.0ms) RELEASE SAVEPOINT active_record_1
111
+  (0.0ms) SAVEPOINT active_record_1
112
+ 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"]]
113
+  (0.0ms) RELEASE SAVEPOINT active_record_1
114
+  (0.0ms) SAVEPOINT active_record_1
115
+ 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"]]
116
+  (0.1ms) RELEASE SAVEPOINT active_record_1
117
+  (0.0ms) SAVEPOINT active_record_1
118
+ 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"]]
119
+  (0.1ms) RELEASE SAVEPOINT active_record_1
120
+  (1.4ms) rollback transaction
121
+  (0.1ms) begin transaction
122
+ ------------------------------------------------------------
123
+ EagerCountingTest: test_count_by_a_directly_associated_model
124
+ ------------------------------------------------------------
125
+  (0.1ms) SAVEPOINT active_record_1
126
+ 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"]]
127
+  (0.0ms) RELEASE SAVEPOINT active_record_1
128
+  (0.0ms) SAVEPOINT active_record_1
129
+ 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"]]
130
+  (0.1ms) RELEASE SAVEPOINT active_record_1
131
+  (0.0ms) SAVEPOINT active_record_1
132
+ 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"]]
133
+  (0.1ms) RELEASE SAVEPOINT active_record_1
134
+  (0.0ms) SAVEPOINT active_record_1
135
+ 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"]]
136
+  (0.1ms) RELEASE SAVEPOINT active_record_1
137
+  (0.0ms) SAVEPOINT active_record_1
138
+ 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"]]
139
+  (0.0ms) RELEASE SAVEPOINT active_record_1
140
+  (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
141
+  (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
142
+  (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]]
143
+  (1.4ms) rollback transaction
144
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
145
+  (0.1ms) begin transaction
146
+ -----------------------------------------------
147
+ EagerCountingTest: test_count_by_a_joined_model
148
+ -----------------------------------------------
149
+  (0.0ms) SAVEPOINT active_record_1
150
+ 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"]]
151
+  (0.1ms) RELEASE SAVEPOINT active_record_1
152
+  (0.1ms) SAVEPOINT active_record_1
153
+ 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"]]
154
+  (0.3ms) RELEASE SAVEPOINT active_record_1
155
+  (0.2ms) SAVEPOINT active_record_1
156
+ 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"]]
157
+  (0.1ms) RELEASE SAVEPOINT active_record_1
158
+  (0.1ms) SAVEPOINT active_record_1
159
+ 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"]]
160
+  (0.0ms) RELEASE SAVEPOINT active_record_1
161
+  (0.0ms) SAVEPOINT active_record_1
162
+ 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"]]
163
+  (0.0ms) RELEASE SAVEPOINT active_record_1
164
+  (0.0ms) SAVEPOINT active_record_1
165
+ 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"]]
166
+  (0.0ms) RELEASE SAVEPOINT active_record_1
167
+  (0.0ms) SAVEPOINT active_record_1
168
+ 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"]]
169
+  (0.0ms) RELEASE SAVEPOINT active_record_1
170
+  (0.0ms) SAVEPOINT active_record_1
171
+ 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"]]
172
+  (0.1ms) RELEASE SAVEPOINT active_record_1
173
+  (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
174
+  (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
175
+  (1.4ms) rollback transaction
176
+  (0.1ms) begin transaction
177
+ ------------------------------------------------------------
178
+ EagerCountingTest: test_count_by_a_directly_associated_model
179
+ ------------------------------------------------------------
180
+  (0.0ms) SAVEPOINT active_record_1
181
+ 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"]]
182
+  (0.1ms) RELEASE SAVEPOINT active_record_1
183
+  (0.0ms) SAVEPOINT active_record_1
184
+ 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"]]
185
+  (0.0ms) RELEASE SAVEPOINT active_record_1
186
+  (0.1ms) SAVEPOINT active_record_1
187
+ 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"]]
188
+  (0.1ms) RELEASE SAVEPOINT active_record_1
189
+  (0.0ms) SAVEPOINT active_record_1
190
+ 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"]]
191
+  (0.0ms) RELEASE SAVEPOINT active_record_1
192
+  (0.0ms) SAVEPOINT active_record_1
193
+ 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"]]
194
+  (0.1ms) RELEASE SAVEPOINT active_record_1
195
+  (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
196
+  (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
197
+  (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]]
198
+  (1.7ms) rollback transaction
199
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
200
+  (0.1ms) begin transaction
201
+ ------------------------------------------------------------
202
+ EagerCountingTest: test_count_by_a_directly_associated_model
203
+ ------------------------------------------------------------
204
+  (0.0ms) SAVEPOINT active_record_1
205
+ 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"]]
206
+  (0.1ms) RELEASE SAVEPOINT active_record_1
207
+  (0.0ms) SAVEPOINT active_record_1
208
+ 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"]]
209
+  (0.0ms) RELEASE SAVEPOINT active_record_1
210
+  (0.1ms) SAVEPOINT active_record_1
211
+ 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"]]
212
+  (0.1ms) RELEASE SAVEPOINT active_record_1
213
+  (0.0ms) SAVEPOINT active_record_1
214
+ 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"]]
215
+  (0.0ms) RELEASE SAVEPOINT active_record_1
216
+  (0.0ms) SAVEPOINT active_record_1
217
+ 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"]]
218
+  (0.0ms) RELEASE SAVEPOINT active_record_1
219
+  (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
220
+  (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
221
+  (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]]
222
+  (1.8ms) rollback transaction
223
+  (0.1ms) begin transaction
224
+ -----------------------------------------------
225
+ EagerCountingTest: test_count_by_a_joined_model
226
+ -----------------------------------------------
227
+  (0.0ms) SAVEPOINT active_record_1
228
+ 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"]]
229
+  (0.0ms) RELEASE SAVEPOINT active_record_1
230
+  (0.0ms) SAVEPOINT active_record_1
231
+ 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"]]
232
+  (0.2ms) RELEASE SAVEPOINT active_record_1
233
+  (0.2ms) SAVEPOINT active_record_1
234
+ 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"]]
235
+  (0.1ms) RELEASE SAVEPOINT active_record_1
236
+  (0.1ms) SAVEPOINT active_record_1
237
+ 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"]]
238
+  (0.0ms) RELEASE SAVEPOINT active_record_1
239
+  (0.0ms) SAVEPOINT active_record_1
240
+ 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"]]
241
+  (0.0ms) RELEASE SAVEPOINT active_record_1
242
+  (0.1ms) SAVEPOINT active_record_1
243
+ 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"]]
244
+  (0.0ms) RELEASE SAVEPOINT active_record_1
245
+  (0.0ms) SAVEPOINT active_record_1
246
+ 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"]]
247
+  (0.0ms) RELEASE SAVEPOINT active_record_1
248
+  (0.0ms) SAVEPOINT active_record_1
249
+ 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"]]
250
+  (0.0ms) RELEASE SAVEPOINT active_record_1
251
+  (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
252
+  (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
253
+  (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]]
254
+  (1.6ms) rollback transaction
255
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
256
+  (0.1ms) begin transaction
257
+ -----------------------------------------------
258
+ EagerCountingTest: test_count_by_a_joined_model
259
+ -----------------------------------------------
260
+  (0.0ms) SAVEPOINT active_record_1
261
+ 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"]]
262
+  (0.0ms) RELEASE SAVEPOINT active_record_1
263
+  (0.0ms) SAVEPOINT active_record_1
264
+ 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"]]
265
+  (0.0ms) RELEASE SAVEPOINT active_record_1
266
+  (0.2ms) SAVEPOINT active_record_1
267
+ 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"]]
268
+  (0.1ms) RELEASE SAVEPOINT active_record_1
269
+  (0.1ms) SAVEPOINT active_record_1
270
+ 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"]]
271
+  (0.0ms) RELEASE SAVEPOINT active_record_1
272
+  (0.0ms) SAVEPOINT active_record_1
273
+ 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"]]
274
+  (0.0ms) RELEASE SAVEPOINT active_record_1
275
+  (0.0ms) SAVEPOINT active_record_1
276
+ 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"]]
277
+  (0.0ms) RELEASE SAVEPOINT active_record_1
278
+  (0.0ms) SAVEPOINT active_record_1
279
+ 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"]]
280
+  (0.1ms) RELEASE SAVEPOINT active_record_1
281
+  (0.0ms) SAVEPOINT active_record_1
282
+ 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"]]
283
+  (0.1ms) RELEASE SAVEPOINT active_record_1
284
+  (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
285
+  (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]]
286
+  (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
287
+  (1.4ms) rollback transaction
288
+  (0.1ms) begin transaction
289
+ -------------------------------------------------------
290
+ EagerCountingTest: test_count_by_a_distant_joined_model
291
+ -------------------------------------------------------
292
+  (0.0ms) SAVEPOINT active_record_1
293
+ 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"]]
294
+  (0.0ms) RELEASE SAVEPOINT active_record_1
295
+  (0.0ms) SAVEPOINT active_record_1
296
+ 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"]]
297
+  (0.0ms) RELEASE SAVEPOINT active_record_1
298
+  (0.1ms) SAVEPOINT active_record_1
299
+ 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"]]
300
+  (0.0ms) RELEASE SAVEPOINT active_record_1
301
+  (0.0ms) SAVEPOINT active_record_1
302
+ 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"]]
303
+  (0.1ms) RELEASE SAVEPOINT active_record_1
304
+  (0.0ms) SAVEPOINT active_record_1
305
+ 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"]]
306
+  (0.0ms) RELEASE SAVEPOINT active_record_1
307
+  (0.0ms) SAVEPOINT active_record_1
308
+ 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"]]
309
+  (0.0ms) RELEASE SAVEPOINT active_record_1
310
+  (0.0ms) SAVEPOINT active_record_1
311
+ 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"]]
312
+  (0.0ms) RELEASE SAVEPOINT active_record_1
313
+  (0.0ms) SAVEPOINT active_record_1
314
+ 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"]]
315
+  (0.0ms) RELEASE SAVEPOINT active_record_1
316
+  (0.0ms) SAVEPOINT active_record_1
317
+ 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"]]
318
+  (0.0ms) RELEASE SAVEPOINT active_record_1
319
+  (0.0ms) SAVEPOINT active_record_1
320
+ 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"]]
321
+  (0.0ms) RELEASE SAVEPOINT active_record_1
322
+  (0.0ms) SAVEPOINT active_record_1
323
+ 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"]]
324
+  (0.0ms) RELEASE SAVEPOINT active_record_1
325
+  (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
326
+  (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]]
327
+  (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
328
+  (1.5ms) rollback transaction
329
+  (0.1ms) begin transaction
330
+ ------------------------------------------------------------
331
+ EagerCountingTest: test_count_by_a_directly_associated_model
332
+ ------------------------------------------------------------
333
+  (0.0ms) SAVEPOINT active_record_1
334
+ 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"]]
335
+  (0.0ms) RELEASE SAVEPOINT active_record_1
336
+  (0.0ms) SAVEPOINT active_record_1
337
+ 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"]]
338
+  (0.0ms) RELEASE SAVEPOINT active_record_1
339
+  (0.0ms) SAVEPOINT active_record_1
340
+ 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"]]
341
+  (0.0ms) RELEASE SAVEPOINT active_record_1
342
+  (0.0ms) SAVEPOINT active_record_1
343
+ 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"]]
344
+  (0.1ms) RELEASE SAVEPOINT active_record_1
345
+  (0.1ms) SAVEPOINT active_record_1
346
+ 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"]]
347
+  (0.1ms) RELEASE SAVEPOINT active_record_1
348
+  (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
349
+  (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]]
350
+  (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
351
+  (1.4ms) rollback transaction
352
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
353
+  (0.2ms) begin transaction
354
+ ------------------------------------------------------------
355
+ EagerCountingTest: test_count_by_a_directly_associated_model
356
+ ------------------------------------------------------------
357
+  (0.1ms) SAVEPOINT active_record_1
358
+ 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"]]
359
+  (0.0ms) RELEASE SAVEPOINT active_record_1
360
+  (0.0ms) SAVEPOINT active_record_1
361
+ 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"]]
362
+  (0.0ms) RELEASE SAVEPOINT active_record_1
363
+  (0.1ms) SAVEPOINT active_record_1
364
+ 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"]]
365
+  (0.0ms) RELEASE SAVEPOINT active_record_1
366
+  (0.0ms) SAVEPOINT active_record_1
367
+ 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"]]
368
+  (0.0ms) RELEASE SAVEPOINT active_record_1
369
+  (0.0ms) SAVEPOINT active_record_1
370
+ 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"]]
371
+  (0.1ms) RELEASE SAVEPOINT active_record_1
372
+  (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
373
+  (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]]
374
+  (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
375
+  (1.4ms) rollback transaction
376
+  (0.1ms) begin transaction
377
+ -------------------------------------------------------
378
+ EagerCountingTest: test_count_by_a_distant_joined_model
379
+ -------------------------------------------------------
380
+  (0.1ms) SAVEPOINT active_record_1
381
+ 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"]]
382
+  (0.1ms) RELEASE SAVEPOINT active_record_1
383
+  (0.0ms) SAVEPOINT active_record_1
384
+ 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"]]
385
+  (0.1ms) RELEASE SAVEPOINT active_record_1
386
+  (0.1ms) SAVEPOINT active_record_1
387
+ 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"]]
388
+  (0.0ms) RELEASE SAVEPOINT active_record_1
389
+  (0.0ms) SAVEPOINT active_record_1
390
+ 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"]]
391
+  (0.0ms) RELEASE SAVEPOINT active_record_1
392
+  (0.1ms) SAVEPOINT active_record_1
393
+ 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"]]
394
+  (0.0ms) RELEASE SAVEPOINT active_record_1
395
+  (0.0ms) SAVEPOINT active_record_1
396
+ 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"]]
397
+  (0.0ms) RELEASE SAVEPOINT active_record_1
398
+  (0.1ms) SAVEPOINT active_record_1
399
+ 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"]]
400
+  (0.1ms) RELEASE SAVEPOINT active_record_1
401
+  (0.0ms) SAVEPOINT active_record_1
402
+ 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"]]
403
+  (0.0ms) RELEASE SAVEPOINT active_record_1
404
+  (0.0ms) SAVEPOINT active_record_1
405
+ 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"]]
406
+  (0.0ms) RELEASE SAVEPOINT active_record_1
407
+  (0.0ms) SAVEPOINT active_record_1
408
+ 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"]]
409
+  (0.1ms) RELEASE SAVEPOINT active_record_1
410
+  (0.0ms) SAVEPOINT active_record_1
411
+ 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"]]
412
+  (0.0ms) RELEASE SAVEPOINT active_record_1
413
+  (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
414
+  (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]]
415
+  (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
416
+  (1.7ms) rollback transaction
417
+  (0.1ms) begin transaction
418
+ ------------------------------------------------------------------------
419
+ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model
420
+ ------------------------------------------------------------------------
421
+  (0.0ms) SAVEPOINT active_record_1
422
+ 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"]]
423
+  (0.0ms) RELEASE SAVEPOINT active_record_1
424
+  (0.0ms) SAVEPOINT active_record_1
425
+ 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"]]
426
+  (0.1ms) RELEASE SAVEPOINT active_record_1
427
+  (0.0ms) SAVEPOINT active_record_1
428
+ 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"]]
429
+  (0.0ms) RELEASE SAVEPOINT active_record_1
430
+  (0.0ms) SAVEPOINT active_record_1
431
+ 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"]]
432
+  (0.0ms) RELEASE SAVEPOINT active_record_1
433
+  (0.0ms) SAVEPOINT active_record_1
434
+ 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"]]
435
+  (0.0ms) RELEASE SAVEPOINT active_record_1
436
+  (0.0ms) SAVEPOINT active_record_1
437
+ 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"]]
438
+  (0.0ms) RELEASE SAVEPOINT active_record_1
439
+  (0.0ms) SAVEPOINT active_record_1
440
+ 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"]]
441
+  (0.0ms) RELEASE SAVEPOINT active_record_1
442
+  (1.3ms) rollback transaction
443
+  (0.1ms) begin transaction
444
+ -----------------------------------------------
445
+ EagerCountingTest: test_count_by_a_joined_model
446
+ -----------------------------------------------
447
+  (0.0ms) SAVEPOINT active_record_1
448
+ 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"]]
449
+  (0.0ms) RELEASE SAVEPOINT active_record_1
450
+  (0.0ms) SAVEPOINT active_record_1
451
+ 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"]]
452
+  (0.0ms) RELEASE SAVEPOINT active_record_1
453
+  (0.1ms) SAVEPOINT active_record_1
454
+ 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"]]
455
+  (0.1ms) RELEASE SAVEPOINT active_record_1
456
+  (0.0ms) SAVEPOINT active_record_1
457
+ 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"]]
458
+  (0.1ms) RELEASE SAVEPOINT active_record_1
459
+  (0.0ms) SAVEPOINT active_record_1
460
+ 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"]]
461
+  (0.0ms) RELEASE SAVEPOINT active_record_1
462
+  (0.0ms) SAVEPOINT active_record_1
463
+ 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"]]
464
+  (0.1ms) RELEASE SAVEPOINT active_record_1
465
+  (0.1ms) SAVEPOINT active_record_1
466
+ 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"]]
467
+  (0.0ms) RELEASE SAVEPOINT active_record_1
468
+  (0.0ms) SAVEPOINT active_record_1
469
+ 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"]]
470
+  (0.0ms) RELEASE SAVEPOINT active_record_1
471
+  (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
472
+  (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]]
473
+  (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
474
+  (1.5ms) rollback transaction
475
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
476
+  (0.1ms) begin transaction
477
+ ------------------------------------------------------------------------
478
+ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model
479
+ ------------------------------------------------------------------------
480
+  (0.1ms) SAVEPOINT active_record_1
481
+ 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"]]
482
+  (0.1ms) RELEASE SAVEPOINT active_record_1
483
+  (0.0ms) SAVEPOINT active_record_1
484
+ 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"]]
485
+  (0.0ms) RELEASE SAVEPOINT active_record_1
486
+  (0.0ms) SAVEPOINT active_record_1
487
+ 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"]]
488
+  (0.0ms) RELEASE SAVEPOINT active_record_1
489
+  (0.0ms) SAVEPOINT active_record_1
490
+ 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"]]
491
+  (0.1ms) RELEASE SAVEPOINT active_record_1
492
+  (0.1ms) SAVEPOINT active_record_1
493
+ 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"]]
494
+  (0.0ms) RELEASE SAVEPOINT active_record_1
495
+  (0.0ms) SAVEPOINT active_record_1
496
+ 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"]]
497
+  (0.0ms) RELEASE SAVEPOINT active_record_1
498
+  (0.0ms) SAVEPOINT active_record_1
499
+ 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"]]
500
+  (0.1ms) RELEASE SAVEPOINT active_record_1
501
+  (1.6ms) rollback transaction
502
+  (0.1ms) begin transaction
503
+ -----------------------------------------------
504
+ EagerCountingTest: test_count_by_a_joined_model
505
+ -----------------------------------------------
506
+  (0.0ms) SAVEPOINT active_record_1
507
+ 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"]]
508
+  (0.2ms) RELEASE SAVEPOINT active_record_1
509
+  (0.1ms) SAVEPOINT active_record_1
510
+ 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"]]
511
+  (0.1ms) RELEASE SAVEPOINT active_record_1
512
+  (0.1ms) SAVEPOINT active_record_1
513
+ 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"]]
514
+  (0.1ms) RELEASE SAVEPOINT active_record_1
515
+  (0.0ms) SAVEPOINT active_record_1
516
+ 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"]]
517
+  (0.0ms) RELEASE SAVEPOINT active_record_1
518
+  (0.0ms) SAVEPOINT active_record_1
519
+ 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"]]
520
+  (0.0ms) RELEASE SAVEPOINT active_record_1
521
+  (0.0ms) SAVEPOINT active_record_1
522
+ 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"]]
523
+  (0.0ms) RELEASE SAVEPOINT active_record_1
524
+  (0.1ms) SAVEPOINT active_record_1
525
+ 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"]]
526
+  (0.0ms) RELEASE SAVEPOINT active_record_1
527
+  (0.0ms) SAVEPOINT active_record_1
528
+ 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"]]
529
+  (0.1ms) RELEASE SAVEPOINT active_record_1
530
+  (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
531
+  (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]]
532
+  (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
533
+  (1.5ms) rollback transaction
534
+  (0.1ms) begin transaction
535
+ -------------------------------------------------------
536
+ EagerCountingTest: test_count_by_a_distant_joined_model
537
+ -------------------------------------------------------
538
+  (0.2ms) SAVEPOINT active_record_1
539
+ 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"]]
540
+  (0.0ms) RELEASE SAVEPOINT active_record_1
541
+  (0.0ms) SAVEPOINT active_record_1
542
+ 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"]]
543
+  (0.0ms) RELEASE SAVEPOINT active_record_1
544
+  (0.0ms) SAVEPOINT active_record_1
545
+ 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"]]
546
+  (0.0ms) RELEASE SAVEPOINT active_record_1
547
+  (0.0ms) SAVEPOINT active_record_1
548
+ 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"]]
549
+  (0.0ms) RELEASE SAVEPOINT active_record_1
550
+  (0.0ms) SAVEPOINT active_record_1
551
+ 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"]]
552
+  (0.0ms) RELEASE SAVEPOINT active_record_1
553
+  (0.0ms) SAVEPOINT active_record_1
554
+ 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"]]
555
+  (0.1ms) RELEASE SAVEPOINT active_record_1
556
+  (0.1ms) SAVEPOINT active_record_1
557
+ 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"]]
558
+  (0.0ms) RELEASE SAVEPOINT active_record_1
559
+  (0.0ms) SAVEPOINT active_record_1
560
+ 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"]]
561
+  (0.0ms) RELEASE SAVEPOINT active_record_1
562
+  (0.0ms) SAVEPOINT active_record_1
563
+ 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"]]
564
+  (0.0ms) RELEASE SAVEPOINT active_record_1
565
+  (0.0ms) SAVEPOINT active_record_1
566
+ 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"]]
567
+  (0.1ms) RELEASE SAVEPOINT active_record_1
568
+  (0.0ms) SAVEPOINT active_record_1
569
+ 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"]]
570
+  (0.0ms) RELEASE SAVEPOINT active_record_1
571
+  (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
572
+  (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]]
573
+  (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
574
+  (1.5ms) rollback transaction
575
+  (0.1ms) begin transaction
576
+ ------------------------------------------------------------
577
+ EagerCountingTest: test_count_by_a_directly_associated_model
578
+ ------------------------------------------------------------
579
+  (0.0ms) SAVEPOINT active_record_1
580
+ 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"]]
581
+  (0.0ms) RELEASE SAVEPOINT active_record_1
582
+  (0.0ms) SAVEPOINT active_record_1
583
+ 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"]]
584
+  (0.0ms) RELEASE SAVEPOINT active_record_1
585
+  (0.0ms) SAVEPOINT active_record_1
586
+ 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"]]
587
+  (0.0ms) RELEASE SAVEPOINT active_record_1
588
+  (0.0ms) SAVEPOINT active_record_1
589
+ 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"]]
590
+  (0.1ms) RELEASE SAVEPOINT active_record_1
591
+  (0.1ms) SAVEPOINT active_record_1
592
+ 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"]]
593
+  (0.0ms) RELEASE SAVEPOINT active_record_1
594
+  (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
595
+  (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]]
596
+  (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
597
+  (1.3ms) rollback transaction
598
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
599
+  (0.1ms) begin transaction
600
+ ------------------------------------------------------------
601
+ EagerCountingTest: test_count_by_a_directly_associated_model
602
+ ------------------------------------------------------------
603
+  (0.1ms) SAVEPOINT active_record_1
604
+ 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"]]
605
+  (0.1ms) RELEASE SAVEPOINT active_record_1
606
+  (0.0ms) SAVEPOINT active_record_1
607
+ 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"]]
608
+  (0.1ms) RELEASE SAVEPOINT active_record_1
609
+  (0.1ms) SAVEPOINT active_record_1
610
+ 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"]]
611
+  (0.0ms) RELEASE SAVEPOINT active_record_1
612
+  (0.0ms) SAVEPOINT active_record_1
613
+ 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"]]
614
+  (0.0ms) RELEASE SAVEPOINT active_record_1
615
+  (0.0ms) SAVEPOINT active_record_1
616
+ 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"]]
617
+  (0.0ms) RELEASE SAVEPOINT active_record_1
618
+  (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
619
+  (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]]
620
+  (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
621
+  (1.3ms) rollback transaction
622
+  (0.1ms) begin transaction
623
+ -------------------------------------------------------
624
+ EagerCountingTest: test_count_by_a_distant_joined_model
625
+ -------------------------------------------------------
626
+  (0.0ms) SAVEPOINT active_record_1
627
+ 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"]]
628
+  (0.1ms) RELEASE SAVEPOINT active_record_1
629
+  (0.2ms) SAVEPOINT active_record_1
630
+ 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"]]
631
+  (0.3ms) RELEASE SAVEPOINT active_record_1
632
+  (0.0ms) SAVEPOINT active_record_1
633
+ 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"]]
634
+  (0.0ms) RELEASE SAVEPOINT active_record_1
635
+  (0.0ms) SAVEPOINT active_record_1
636
+ 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"]]
637
+  (0.0ms) RELEASE SAVEPOINT active_record_1
638
+  (0.1ms) SAVEPOINT active_record_1
639
+ 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"]]
640
+  (0.1ms) RELEASE SAVEPOINT active_record_1
641
+  (0.1ms) SAVEPOINT active_record_1
642
+ 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"]]
643
+  (0.0ms) RELEASE SAVEPOINT active_record_1
644
+  (0.0ms) SAVEPOINT active_record_1
645
+ 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"]]
646
+  (0.0ms) RELEASE SAVEPOINT active_record_1
647
+  (0.0ms) SAVEPOINT active_record_1
648
+ 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"]]
649
+  (0.1ms) RELEASE SAVEPOINT active_record_1
650
+  (0.0ms) SAVEPOINT active_record_1
651
+ 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"]]
652
+  (0.1ms) RELEASE SAVEPOINT active_record_1
653
+  (0.0ms) SAVEPOINT active_record_1
654
+ 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"]]
655
+  (0.0ms) RELEASE SAVEPOINT active_record_1
656
+  (0.0ms) SAVEPOINT active_record_1
657
+ 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"]]
658
+  (0.1ms) RELEASE SAVEPOINT active_record_1
659
+  (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
660
+  (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]]
661
+  (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
662
+  (1.4ms) rollback transaction
663
+  (0.1ms) begin transaction
664
+ -----------------------------------------------
665
+ EagerCountingTest: test_count_by_a_joined_model
666
+ -----------------------------------------------
667
+  (0.1ms) SAVEPOINT active_record_1
668
+ 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"]]
669
+  (0.0ms) RELEASE SAVEPOINT active_record_1
670
+  (0.0ms) SAVEPOINT active_record_1
671
+ 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"]]
672
+  (0.0ms) RELEASE SAVEPOINT active_record_1
673
+  (0.0ms) SAVEPOINT active_record_1
674
+ 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"]]
675
+  (0.0ms) RELEASE SAVEPOINT active_record_1
676
+  (0.0ms) SAVEPOINT active_record_1
677
+ 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"]]
678
+  (0.0ms) RELEASE SAVEPOINT active_record_1
679
+  (0.0ms) SAVEPOINT active_record_1
680
+ 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"]]
681
+  (0.0ms) RELEASE SAVEPOINT active_record_1
682
+  (0.0ms) SAVEPOINT active_record_1
683
+ 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"]]
684
+  (0.0ms) RELEASE SAVEPOINT active_record_1
685
+  (0.0ms) SAVEPOINT active_record_1
686
+ 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"]]
687
+  (0.1ms) RELEASE SAVEPOINT active_record_1
688
+  (0.0ms) SAVEPOINT active_record_1
689
+ 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"]]
690
+  (0.0ms) RELEASE SAVEPOINT active_record_1
691
+  (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
692
+  (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]]
693
+  (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
694
+  (1.5ms) rollback transaction
695
+  (0.1ms) begin transaction
696
+ ------------------------------------------------------------------------
697
+ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model
698
+ ------------------------------------------------------------------------
699
+  (0.1ms) SAVEPOINT active_record_1
700
+ 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"]]
701
+  (0.0ms) RELEASE SAVEPOINT active_record_1
702
+  (0.0ms) SAVEPOINT active_record_1
703
+ 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"]]
704
+  (0.0ms) RELEASE SAVEPOINT active_record_1
705
+  (0.0ms) SAVEPOINT active_record_1
706
+ 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"]]
707
+  (0.0ms) RELEASE SAVEPOINT active_record_1
708
+  (0.0ms) SAVEPOINT active_record_1
709
+ 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"]]
710
+  (0.1ms) RELEASE SAVEPOINT active_record_1
711
+  (0.1ms) SAVEPOINT active_record_1
712
+ 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"]]
713
+  (0.0ms) RELEASE SAVEPOINT active_record_1
714
+  (0.0ms) SAVEPOINT active_record_1
715
+ 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"]]
716
+  (0.0ms) RELEASE SAVEPOINT active_record_1
717
+  (0.0ms) SAVEPOINT active_record_1
718
+ 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"]]
719
+  (0.0ms) RELEASE SAVEPOINT active_record_1
720
+  (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
721
+  (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]]
722
+  (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
723
+  (1.6ms) rollback transaction
724
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
725
+  (0.1ms) begin transaction
726
+ ------------------------------------------------------------------------
727
+ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model
728
+ ------------------------------------------------------------------------
729
+  (0.0ms) SAVEPOINT active_record_1
730
+ 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"]]
731
+  (0.0ms) RELEASE SAVEPOINT active_record_1
732
+  (0.0ms) SAVEPOINT active_record_1
733
+ 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"]]
734
+  (0.0ms) RELEASE SAVEPOINT active_record_1
735
+  (0.0ms) SAVEPOINT active_record_1
736
+ 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"]]
737
+  (0.0ms) RELEASE SAVEPOINT active_record_1
738
+  (0.0ms) SAVEPOINT active_record_1
739
+ 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"]]
740
+  (0.0ms) RELEASE SAVEPOINT active_record_1
741
+  (0.1ms) SAVEPOINT active_record_1
742
+ 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"]]
743
+  (0.0ms) RELEASE SAVEPOINT active_record_1
744
+  (0.1ms) SAVEPOINT active_record_1
745
+ 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"]]
746
+  (0.0ms) RELEASE SAVEPOINT active_record_1
747
+  (0.0ms) SAVEPOINT active_record_1
748
+ 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"]]
749
+  (0.1ms) RELEASE SAVEPOINT active_record_1
750
+  (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
751
+  (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]]
752
+  (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
753
+  (1.3ms) rollback transaction
754
+  (0.1ms) begin transaction
755
+ -------------------------------------------------------
756
+ EagerCountingTest: test_count_by_a_distant_joined_model
757
+ -------------------------------------------------------
758
+  (0.1ms) SAVEPOINT active_record_1
759
+ 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"]]
760
+  (0.1ms) RELEASE SAVEPOINT active_record_1
761
+  (0.1ms) SAVEPOINT active_record_1
762
+ 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"]]
763
+  (0.1ms) RELEASE SAVEPOINT active_record_1
764
+  (0.1ms) SAVEPOINT active_record_1
765
+ 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"]]
766
+  (0.0ms) RELEASE SAVEPOINT active_record_1
767
+  (0.0ms) SAVEPOINT active_record_1
768
+ 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"]]
769
+  (0.0ms) RELEASE SAVEPOINT active_record_1
770
+  (0.0ms) SAVEPOINT active_record_1
771
+ 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"]]
772
+  (0.1ms) RELEASE SAVEPOINT active_record_1
773
+  (0.0ms) SAVEPOINT active_record_1
774
+ 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"]]
775
+  (0.1ms) RELEASE SAVEPOINT active_record_1
776
+  (0.0ms) SAVEPOINT active_record_1
777
+ 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"]]
778
+  (0.0ms) RELEASE SAVEPOINT active_record_1
779
+  (0.0ms) SAVEPOINT active_record_1
780
+ 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"]]
781
+  (0.0ms) RELEASE SAVEPOINT active_record_1
782
+  (0.0ms) SAVEPOINT active_record_1
783
+ 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"]]
784
+  (0.0ms) RELEASE SAVEPOINT active_record_1
785
+  (0.0ms) SAVEPOINT active_record_1
786
+ 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"]]
787
+  (0.0ms) RELEASE SAVEPOINT active_record_1
788
+  (0.0ms) SAVEPOINT active_record_1
789
+ 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"]]
790
+  (0.0ms) RELEASE SAVEPOINT active_record_1
791
+  (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
792
+  (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]]
793
+  (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
794
+  (1.5ms) rollback transaction
795
+  (0.1ms) begin transaction
796
+ ------------------------------------------------------------
797
+ EagerCountingTest: test_count_by_a_directly_associated_model
798
+ ------------------------------------------------------------
799
+  (0.0ms) SAVEPOINT active_record_1
800
+ 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"]]
801
+  (0.1ms) RELEASE SAVEPOINT active_record_1
802
+  (0.1ms) SAVEPOINT active_record_1
803
+ 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"]]
804
+  (0.0ms) RELEASE SAVEPOINT active_record_1
805
+  (0.1ms) SAVEPOINT active_record_1
806
+ 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"]]
807
+  (0.0ms) RELEASE SAVEPOINT active_record_1
808
+  (0.0ms) SAVEPOINT active_record_1
809
+ 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"]]
810
+  (0.0ms) RELEASE SAVEPOINT active_record_1
811
+  (0.0ms) SAVEPOINT active_record_1
812
+ 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"]]
813
+  (0.0ms) RELEASE SAVEPOINT active_record_1
814
+  (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
815
+  (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]]
816
+  (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
817
+  (1.5ms) rollback transaction
818
+  (0.1ms) begin transaction
819
+ -----------------------------------------------
820
+ EagerCountingTest: test_count_by_a_joined_model
821
+ -----------------------------------------------
822
+  (0.0ms) SAVEPOINT active_record_1
823
+ 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"]]
824
+  (0.0ms) RELEASE SAVEPOINT active_record_1
825
+  (0.0ms) SAVEPOINT active_record_1
826
+ 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"]]
827
+  (0.0ms) RELEASE SAVEPOINT active_record_1
828
+  (0.1ms) SAVEPOINT active_record_1
829
+ 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"]]
830
+  (0.0ms) RELEASE SAVEPOINT active_record_1
831
+  (0.0ms) SAVEPOINT active_record_1
832
+ 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"]]
833
+  (0.0ms) RELEASE SAVEPOINT active_record_1
834
+  (0.0ms) SAVEPOINT active_record_1
835
+ 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"]]
836
+  (0.0ms) RELEASE SAVEPOINT active_record_1
837
+  (0.0ms) SAVEPOINT active_record_1
838
+ 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"]]
839
+  (0.0ms) RELEASE SAVEPOINT active_record_1
840
+  (0.0ms) SAVEPOINT active_record_1
841
+ 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"]]
842
+  (0.0ms) RELEASE SAVEPOINT active_record_1
843
+  (0.1ms) SAVEPOINT active_record_1
844
+ 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"]]
845
+  (0.0ms) RELEASE SAVEPOINT active_record_1
846
+  (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
847
+  (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]]
848
+  (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
849
+  (1.5ms) rollback transaction
850
+  (0.2ms) begin transaction
851
+ ---------------------------------------------------------------
852
+ EagerCountingTest: test_count_by_polymorphicly_associated_model
853
+ ---------------------------------------------------------------
854
+  (0.3ms) SAVEPOINT active_record_1
855
+ 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"]]
856
+  (0.1ms) RELEASE SAVEPOINT active_record_1
857
+  (0.1ms) SAVEPOINT active_record_1
858
+ 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"]]
859
+  (0.1ms) RELEASE SAVEPOINT active_record_1
860
+  (1.4ms) rollback transaction
861
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
862
+  (0.1ms) begin transaction
863
+ ------------------------------------------------------------
864
+ EagerCountingTest: test_count_by_a_directly_associated_model
865
+ ------------------------------------------------------------
866
+  (0.0ms) SAVEPOINT active_record_1
867
+ 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"]]
868
+  (0.0ms) RELEASE SAVEPOINT active_record_1
869
+  (0.0ms) SAVEPOINT active_record_1
870
+ 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"]]
871
+  (0.1ms) RELEASE SAVEPOINT active_record_1
872
+  (0.1ms) SAVEPOINT active_record_1
873
+ 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"]]
874
+  (0.0ms) RELEASE SAVEPOINT active_record_1
875
+  (0.0ms) SAVEPOINT active_record_1
876
+ 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"]]
877
+  (0.0ms) RELEASE SAVEPOINT active_record_1
878
+  (0.0ms) SAVEPOINT active_record_1
879
+ 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"]]
880
+  (0.0ms) RELEASE SAVEPOINT active_record_1
881
+  (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
882
+  (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]]
883
+  (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
884
+  (1.4ms) rollback transaction
885
+  (0.1ms) begin transaction
886
+ -------------------------------------------------------
887
+ EagerCountingTest: test_count_by_a_distant_joined_model
888
+ -------------------------------------------------------
889
+  (0.0ms) SAVEPOINT active_record_1
890
+ 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"]]
891
+  (0.1ms) RELEASE SAVEPOINT active_record_1
892
+  (0.1ms) SAVEPOINT active_record_1
893
+ 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"]]
894
+  (0.1ms) RELEASE SAVEPOINT active_record_1
895
+  (0.1ms) SAVEPOINT active_record_1
896
+ 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"]]
897
+  (0.1ms) RELEASE SAVEPOINT active_record_1
898
+  (0.0ms) SAVEPOINT active_record_1
899
+ 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"]]
900
+  (0.0ms) RELEASE SAVEPOINT active_record_1
901
+  (0.1ms) SAVEPOINT active_record_1
902
+ 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"]]
903
+  (0.0ms) RELEASE SAVEPOINT active_record_1
904
+  (0.0ms) SAVEPOINT active_record_1
905
+ 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"]]
906
+  (0.0ms) RELEASE SAVEPOINT active_record_1
907
+  (0.0ms) SAVEPOINT active_record_1
908
+ 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"]]
909
+  (0.0ms) RELEASE SAVEPOINT active_record_1
910
+  (0.0ms) SAVEPOINT active_record_1
911
+ 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"]]
912
+  (0.0ms) RELEASE SAVEPOINT active_record_1
913
+  (0.0ms) SAVEPOINT active_record_1
914
+ 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"]]
915
+  (0.0ms) RELEASE SAVEPOINT active_record_1
916
+  (0.0ms) SAVEPOINT active_record_1
917
+ 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"]]
918
+  (0.0ms) RELEASE SAVEPOINT active_record_1
919
+  (0.0ms) SAVEPOINT active_record_1
920
+ 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"]]
921
+  (0.1ms) RELEASE SAVEPOINT active_record_1
922
+  (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
923
+  (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]]
924
+  (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
925
+  (1.4ms) rollback transaction
926
+  (0.1ms) begin transaction
927
+ ------------------------------------------------------------------------
928
+ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model
929
+ ------------------------------------------------------------------------
930
+  (0.0ms) SAVEPOINT active_record_1
931
+ 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"]]
932
+  (0.0ms) RELEASE SAVEPOINT active_record_1
933
+  (0.0ms) SAVEPOINT active_record_1
934
+ 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"]]
935
+  (0.0ms) RELEASE SAVEPOINT active_record_1
936
+  (0.0ms) SAVEPOINT active_record_1
937
+ 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"]]
938
+  (0.0ms) RELEASE SAVEPOINT active_record_1
939
+  (0.0ms) SAVEPOINT active_record_1
940
+ 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"]]
941
+  (0.0ms) RELEASE SAVEPOINT active_record_1
942
+  (0.0ms) SAVEPOINT active_record_1
943
+ 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"]]
944
+  (0.1ms) RELEASE SAVEPOINT active_record_1
945
+  (0.0ms) SAVEPOINT active_record_1
946
+ 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"]]
947
+  (0.0ms) RELEASE SAVEPOINT active_record_1
948
+  (0.0ms) SAVEPOINT active_record_1
949
+ 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"]]
950
+  (0.0ms) RELEASE SAVEPOINT active_record_1
951
+  (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
952
+  (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]]
953
+  (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
954
+  (1.5ms) rollback transaction
955
+  (0.1ms) begin transaction
956
+ -----------------------------------------------
957
+ EagerCountingTest: test_count_by_a_joined_model
958
+ -----------------------------------------------
959
+  (0.0ms) SAVEPOINT active_record_1
960
+ 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"]]
961
+  (0.0ms) RELEASE SAVEPOINT active_record_1
962
+  (0.0ms) SAVEPOINT active_record_1
963
+ 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"]]
964
+  (0.0ms) RELEASE SAVEPOINT active_record_1
965
+  (0.0ms) SAVEPOINT active_record_1
966
+ 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"]]
967
+  (0.1ms) RELEASE SAVEPOINT active_record_1
968
+  (0.0ms) SAVEPOINT active_record_1
969
+ 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"]]
970
+  (0.0ms) RELEASE SAVEPOINT active_record_1
971
+  (0.0ms) SAVEPOINT active_record_1
972
+ 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"]]
973
+  (0.0ms) RELEASE SAVEPOINT active_record_1
974
+  (0.0ms) SAVEPOINT active_record_1
975
+ 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"]]
976
+  (0.0ms) RELEASE SAVEPOINT active_record_1
977
+  (0.0ms) SAVEPOINT active_record_1
978
+ 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"]]
979
+  (0.0ms) RELEASE SAVEPOINT active_record_1
980
+  (0.0ms) SAVEPOINT active_record_1
981
+ 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"]]
982
+  (0.1ms) RELEASE SAVEPOINT active_record_1
983
+  (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
984
+  (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]]
985
+  (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
986
+  (2.0ms) rollback transaction
987
+  (0.1ms) begin transaction
988
+ ---------------------------------------------------------------
989
+ EagerCountingTest: test_count_by_polymorphicly_associated_model
990
+ ---------------------------------------------------------------
991
+  (0.1ms) SAVEPOINT active_record_1
992
+ 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"]]
993
+  (0.0ms) RELEASE SAVEPOINT active_record_1
994
+  (0.0ms) SAVEPOINT active_record_1
995
+ 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"]]
996
+  (0.2ms) RELEASE SAVEPOINT active_record_1
997
+  (0.1ms) SAVEPOINT active_record_1
998
+ 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"]]
999
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1000
+  (0.0ms) SAVEPOINT active_record_1
1001
+ 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"]]
1002
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1003
+  (0.0ms) SAVEPOINT active_record_1
1004
+ 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"]]
1005
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1006
+  (1.4ms) rollback transaction
1007
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1008
+  (0.1ms) begin transaction
1009
+ ------------------------------------------------------------------------
1010
+ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model
1011
+ ------------------------------------------------------------------------
1012
+  (0.1ms) SAVEPOINT active_record_1
1013
+ 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"]]
1014
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1015
+  (0.0ms) SAVEPOINT active_record_1
1016
+ 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"]]
1017
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1018
+  (0.0ms) SAVEPOINT active_record_1
1019
+ 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"]]
1020
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1021
+  (0.0ms) SAVEPOINT active_record_1
1022
+ 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"]]
1023
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1024
+  (0.1ms) SAVEPOINT active_record_1
1025
+ 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"]]
1026
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1027
+  (0.0ms) SAVEPOINT active_record_1
1028
+ 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"]]
1029
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1030
+  (0.0ms) SAVEPOINT active_record_1
1031
+ 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"]]
1032
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1033
+  (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
1034
+  (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]]
1035
+  (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
1036
+  (1.5ms) rollback transaction
1037
+  (0.1ms) begin transaction
1038
+ ------------------------------------------------------------
1039
+ EagerCountingTest: test_count_by_a_directly_associated_model
1040
+ ------------------------------------------------------------
1041
+  (0.0ms) SAVEPOINT active_record_1
1042
+ 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"]]
1043
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1044
+  (0.0ms) SAVEPOINT active_record_1
1045
+ 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"]]
1046
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1047
+  (0.0ms) SAVEPOINT active_record_1
1048
+ 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"]]
1049
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1050
+  (0.0ms) SAVEPOINT active_record_1
1051
+ 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"]]
1052
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1053
+  (0.0ms) SAVEPOINT active_record_1
1054
+ 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"]]
1055
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1056
+  (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
1057
+  (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]]
1058
+  (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
1059
+  (1.5ms) rollback transaction
1060
+  (0.1ms) begin transaction
1061
+ -----------------------------------------------
1062
+ EagerCountingTest: test_count_by_a_joined_model
1063
+ -----------------------------------------------
1064
+  (0.1ms) SAVEPOINT active_record_1
1065
+ 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"]]
1066
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1067
+  (0.1ms) SAVEPOINT active_record_1
1068
+ 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"]]
1069
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1070
+  (0.0ms) SAVEPOINT active_record_1
1071
+ 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"]]
1072
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1073
+  (0.1ms) SAVEPOINT active_record_1
1074
+ 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"]]
1075
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1076
+  (0.1ms) SAVEPOINT active_record_1
1077
+ 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"]]
1078
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1079
+  (0.0ms) SAVEPOINT active_record_1
1080
+ 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"]]
1081
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1082
+  (0.0ms) SAVEPOINT active_record_1
1083
+ 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"]]
1084
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1085
+  (0.0ms) SAVEPOINT active_record_1
1086
+ 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"]]
1087
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1088
+  (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
1089
+  (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]]
1090
+  (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
1091
+  (1.4ms) rollback transaction
1092
+  (0.1ms) begin transaction
1093
+ -------------------------------------------------------
1094
+ EagerCountingTest: test_count_by_a_distant_joined_model
1095
+ -------------------------------------------------------
1096
+  (0.0ms) SAVEPOINT active_record_1
1097
+ 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"]]
1098
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1099
+  (0.0ms) SAVEPOINT active_record_1
1100
+ 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"]]
1101
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1102
+  (0.0ms) SAVEPOINT active_record_1
1103
+ 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"]]
1104
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1105
+  (0.0ms) SAVEPOINT active_record_1
1106
+ 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"]]
1107
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1108
+  (0.0ms) SAVEPOINT active_record_1
1109
+ 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"]]
1110
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1111
+  (0.0ms) SAVEPOINT active_record_1
1112
+ 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"]]
1113
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1114
+  (0.0ms) SAVEPOINT active_record_1
1115
+ 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"]]
1116
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1117
+  (0.0ms) SAVEPOINT active_record_1
1118
+ 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"]]
1119
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1120
+  (0.0ms) SAVEPOINT active_record_1
1121
+ 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"]]
1122
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1123
+  (0.0ms) SAVEPOINT active_record_1
1124
+ 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"]]
1125
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1126
+  (0.0ms) SAVEPOINT active_record_1
1127
+ 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"]]
1128
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1129
+  (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
1130
+  (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]]
1131
+  (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
1132
+  (1.5ms) rollback transaction
1133
+  (0.1ms) begin transaction
1134
+ ---------------------------------------------------------------
1135
+ EagerCountingTest: test_count_by_polymorphicly_associated_model
1136
+ ---------------------------------------------------------------
1137
+  (0.1ms) SAVEPOINT active_record_1
1138
+ 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"]]
1139
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1140
+  (0.0ms) SAVEPOINT active_record_1
1141
+ 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"]]
1142
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1143
+  (0.1ms) SAVEPOINT active_record_1
1144
+ 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"]]
1145
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1146
+  (0.1ms) SAVEPOINT active_record_1
1147
+ 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"]]
1148
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1149
+  (0.0ms) SAVEPOINT active_record_1
1150
+ 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"]]
1151
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1152
+  (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
1153
+  (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]]
1154
+  (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
1155
+  (1.5ms) rollback transaction
1156
+  (0.3ms) begin transaction
1157
+ ------------------------------------------------------------
1158
+ EagerCountingTest: test_count_by_a_directly_associated_model
1159
+ ------------------------------------------------------------
1160
+  (0.0ms) SAVEPOINT active_record_1
1161
+ 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]]
1162
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1163
+  (0.0ms) SAVEPOINT active_record_1
1164
+ 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]]
1165
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1166
+  (0.1ms) SAVEPOINT active_record_1
1167
+ 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]]
1168
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1169
+  (0.0ms) SAVEPOINT active_record_1
1170
+ 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]]
1171
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1172
+  (0.0ms) SAVEPOINT active_record_1
1173
+ 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]]
1174
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1175
+  (1.6ms) rollback transaction
1176
+  (0.1ms) begin transaction
1177
+ -------------------------------------------------------
1178
+ EagerCountingTest: test_count_by_a_distant_joined_model
1179
+ -------------------------------------------------------
1180
+  (0.0ms) SAVEPOINT active_record_1
1181
+ 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]]
1182
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1183
+  (0.0ms) SAVEPOINT active_record_1
1184
+ 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]]
1185
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1186
+  (0.0ms) SAVEPOINT active_record_1
1187
+ 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]]
1188
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1189
+  (0.0ms) SAVEPOINT active_record_1
1190
+ 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]]
1191
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1192
+  (0.1ms) SAVEPOINT active_record_1
1193
+ 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]]
1194
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1195
+  (0.0ms) SAVEPOINT active_record_1
1196
+ 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]]
1197
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1198
+  (0.0ms) SAVEPOINT active_record_1
1199
+ 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]]
1200
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1201
+  (0.0ms) SAVEPOINT active_record_1
1202
+ 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]]
1203
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1204
+  (0.0ms) SAVEPOINT active_record_1
1205
+ 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]]
1206
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1207
+  (0.0ms) SAVEPOINT active_record_1
1208
+ 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]]
1209
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1210
+  (0.0ms) SAVEPOINT active_record_1
1211
+ 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]]
1212
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1213
+  (1.3ms) rollback transaction
1214
+  (0.1ms) begin transaction
1215
+ -----------------------------------------------
1216
+ EagerCountingTest: test_count_by_a_joined_model
1217
+ -----------------------------------------------
1218
+  (0.0ms) SAVEPOINT active_record_1
1219
+ 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]]
1220
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1221
+  (0.0ms) SAVEPOINT active_record_1
1222
+ 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]]
1223
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1224
+  (0.0ms) SAVEPOINT active_record_1
1225
+ 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]]
1226
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1227
+  (0.0ms) SAVEPOINT active_record_1
1228
+ 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]]
1229
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1230
+  (0.0ms) SAVEPOINT active_record_1
1231
+ 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]]
1232
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1233
+  (0.0ms) SAVEPOINT active_record_1
1234
+ 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]]
1235
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1236
+  (0.1ms) SAVEPOINT active_record_1
1237
+ 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]]
1238
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1239
+  (0.1ms) SAVEPOINT active_record_1
1240
+ 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]]
1241
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1242
+  (1.4ms) rollback transaction
1243
+  (0.1ms) begin transaction
1244
+ ------------------------------------------------------------------------
1245
+ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model
1246
+ ------------------------------------------------------------------------
1247
+  (0.0ms) SAVEPOINT active_record_1
1248
+ 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]]
1249
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1250
+  (0.0ms) SAVEPOINT active_record_1
1251
+ 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]]
1252
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1253
+  (0.0ms) SAVEPOINT active_record_1
1254
+ 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]]
1255
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1256
+  (0.1ms) SAVEPOINT active_record_1
1257
+ 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]]
1258
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1259
+  (0.0ms) SAVEPOINT active_record_1
1260
+ 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]]
1261
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1262
+  (0.0ms) SAVEPOINT active_record_1
1263
+ 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]]
1264
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1265
+  (0.0ms) SAVEPOINT active_record_1
1266
+ 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]]
1267
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1268
+  (1.4ms) rollback transaction
1269
+  (0.1ms) begin transaction
1270
+ ---------------------------------------------------------------
1271
+ EagerCountingTest: test_count_by_polymorphicly_associated_model
1272
+ ---------------------------------------------------------------
1273
+  (0.1ms) SAVEPOINT active_record_1
1274
+ 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]]
1275
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1276
+  (0.1ms) SAVEPOINT active_record_1
1277
+ 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]]
1278
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1279
+  (0.1ms) SAVEPOINT active_record_1
1280
+ 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]]
1281
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1282
+  (0.0ms) SAVEPOINT active_record_1
1283
+ 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]]
1284
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1285
+  (0.0ms) SAVEPOINT active_record_1
1286
+ 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]]
1287
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1288
+  (1.5ms) rollback transaction
1289
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1290
+  (0.1ms) begin transaction
1291
+ -----------------------------------------------
1292
+ EagerCountingTest: test_count_by_a_joined_model
1293
+ -----------------------------------------------
1294
+  (0.0ms) SAVEPOINT active_record_1
1295
+ 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"]]
1296
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1297
+  (0.0ms) SAVEPOINT active_record_1
1298
+ 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"]]
1299
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1300
+  (0.1ms) SAVEPOINT active_record_1
1301
+ 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"]]
1302
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1303
+  (0.1ms) SAVEPOINT active_record_1
1304
+ 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"]]
1305
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1306
+  (0.0ms) SAVEPOINT active_record_1
1307
+ 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"]]
1308
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1309
+  (0.1ms) SAVEPOINT active_record_1
1310
+ 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"]]
1311
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1312
+  (0.1ms) SAVEPOINT active_record_1
1313
+ 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"]]
1314
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1315
+  (0.1ms) SAVEPOINT active_record_1
1316
+ 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"]]
1317
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1318
+  (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
1319
+  (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]]
1320
+  (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
1321
+  (1.5ms) rollback transaction
1322
+  (0.1ms) begin transaction
1323
+ -------------------------------------------------------
1324
+ EagerCountingTest: test_count_by_a_distant_joined_model
1325
+ -------------------------------------------------------
1326
+  (0.0ms) SAVEPOINT active_record_1
1327
+ 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"]]
1328
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1329
+  (0.0ms) SAVEPOINT active_record_1
1330
+ 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"]]
1331
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1332
+  (0.1ms) SAVEPOINT active_record_1
1333
+ 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"]]
1334
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1335
+  (0.0ms) SAVEPOINT active_record_1
1336
+ 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"]]
1337
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1338
+  (0.0ms) SAVEPOINT active_record_1
1339
+ 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"]]
1340
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1341
+  (0.0ms) SAVEPOINT active_record_1
1342
+ 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"]]
1343
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1344
+  (0.0ms) SAVEPOINT active_record_1
1345
+ 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"]]
1346
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1347
+  (0.0ms) SAVEPOINT active_record_1
1348
+ 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"]]
1349
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1350
+  (0.0ms) SAVEPOINT active_record_1
1351
+ 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"]]
1352
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1353
+  (0.0ms) SAVEPOINT active_record_1
1354
+ 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"]]
1355
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1356
+  (0.0ms) SAVEPOINT active_record_1
1357
+ 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"]]
1358
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1359
+  (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
1360
+  (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]]
1361
+  (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
1362
+  (1.5ms) rollback transaction
1363
+  (0.1ms) begin transaction
1364
+ ---------------------------------------------------------------
1365
+ EagerCountingTest: test_count_by_polymorphicly_associated_model
1366
+ ---------------------------------------------------------------
1367
+  (0.0ms) SAVEPOINT active_record_1
1368
+ 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"]]
1369
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1370
+  (0.0ms) SAVEPOINT active_record_1
1371
+ 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"]]
1372
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1373
+  (0.1ms) SAVEPOINT active_record_1
1374
+ 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"]]
1375
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1376
+  (0.0ms) SAVEPOINT active_record_1
1377
+ 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"]]
1378
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1379
+  (0.0ms) SAVEPOINT active_record_1
1380
+ 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"]]
1381
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1382
+  (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
1383
+  (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]]
1384
+  (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
1385
+  (1.4ms) rollback transaction
1386
+  (0.1ms) begin transaction
1387
+ ------------------------------------------------------------------------
1388
+ EagerCountingTest: test_count_by_a_via_has_many_association_joined_model
1389
+ ------------------------------------------------------------------------
1390
+  (0.0ms) SAVEPOINT active_record_1
1391
+ 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"]]
1392
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1393
+  (0.0ms) SAVEPOINT active_record_1
1394
+ 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"]]
1395
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1396
+  (0.0ms) SAVEPOINT active_record_1
1397
+ 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"]]
1398
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1399
+  (0.0ms) SAVEPOINT active_record_1
1400
+ 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"]]
1401
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1402
+  (0.1ms) SAVEPOINT active_record_1
1403
+ 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"]]
1404
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1405
+  (0.0ms) SAVEPOINT active_record_1
1406
+ 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"]]
1407
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1408
+  (0.0ms) SAVEPOINT active_record_1
1409
+ 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"]]
1410
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1411
+  (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
1412
+  (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]]
1413
+  (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
1414
+  (1.4ms) rollback transaction
1415
+  (0.1ms) begin transaction
1416
+ ------------------------------------------------------------
1417
+ EagerCountingTest: test_count_by_a_directly_associated_model
1418
+ ------------------------------------------------------------
1419
+  (0.0ms) SAVEPOINT active_record_1
1420
+ 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"]]
1421
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1422
+  (0.0ms) SAVEPOINT active_record_1
1423
+ 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"]]
1424
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1425
+  (0.0ms) SAVEPOINT active_record_1
1426
+ 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"]]
1427
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1428
+  (0.0ms) SAVEPOINT active_record_1
1429
+ 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"]]
1430
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1431
+  (0.0ms) SAVEPOINT active_record_1
1432
+ 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"]]
1433
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1434
+  (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
1435
+  (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]]
1436
+  (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
1437
+  (1.5ms) rollback transaction