I'm using charlotte-ruby/impressionist to track impressions within my rails app.
I have a very simple implementation, similar to what's shown in the quick start guide. Effectively: - Controller: impressionist actions: [:show, :index] - View: @post.impressionist_count - Model: is_impressionable
I ran into some DB queuing issues today, and found the following when checking out my expensive queries within Heroku Postgres:
I immediately removed impressionist from my controllers/views (at 14:30), and you can see how it impacted performance:
Has anyone run into a similar issue with the impressionist gem? Any ideas of why it's so expensive from a DB perspective?
EDIT:
Here are the indexes that were added:
add_index "impressions", ["controller_name", "action_name", "ip_address"], name: "controlleraction_ip_index", using: :btree
add_index "impressions", ["controller_name", "action_name", "request_hash"], name: "controlleraction_request_index", using: :btree
add_index "impressions", ["controller_name", "action_name", "session_hash"], name: "controlleraction_session_index", using: :btree
add_index "impressions", ["impressionable_type", "impressionable_id", "ip_address"], name: "poly_ip_index", using: :btree
add_index "impressions", ["impressionable_type", "impressionable_id", "request_hash"], name: "poly_request_index", using: :btree
add_index "impressions", ["impressionable_type", "impressionable_id", "session_hash"], name: "poly_session_index", using: :btree
add_index "impressions", ["impressionable_type", "message", "impressionable_id"], name: "impressionable_type_message_index", using: :btree
add_index "impressions", ["user_id"], name: "index_impressions_on_user_id", using: :btree