PgHero
No long running queries
Connections healthy 53
Vacuuming healthy
No columns near integer overflow
No invalid indexes
2 duplicate indexes
No suggested indexes
1 slow query

Duplicate Indexes

These indexes exist, but aren’t needed. Remove them with a migration for faster writes.

Details
On ahoy_events
index_ahoy_events_on_user_id (user_id)
is covered by
index_ahoy_events_on_user_id_and_name (user_id, name)
On ahoy_events
index_ahoy_events_on_visit_id (visit_id)
is covered by
index_ahoy_events_on_visit_id_and_name (visit_id, name)

Slow Queries

Slow queries take 20 ms or more on average and have been called at least 100 times.

Explain queries to see where to add indexes.

Total Time Average Time Calls
0 min 3% 43 ms 105 datakick · details
SELECT  "items"."id" AS t0_r0, "items"."gtin" AS t0_r1, "items"."created_at" AS t0_r2, "items"."updated_at" AS t0_r3, "items"."current_revision_id" AS t0_r4, "revisions"."id" AS t1_r0, "revisions"."item_id" AS t1_r1, "revisions"."name" AS t1_r2, "revisions"."size" AS t1_r3, "revisions"."author" AS t1_r4, "revisions"."ip" AS t1_r5, "revisions"."user_agent" AS t1_r6, "revisions"."created_at" AS t1_r7, "revisions"."serving_size" AS t1_r8, "revisions"."servings_per_container" AS t1_r9, "revisions"."calories" AS t1_r10, "revisions"."fat" AS t1_r11, "revisions"."saturated_fat" AS t1_r12, "revisions"."trans_fat" AS t1_r13, "revisions"."cholesterol" AS t1_r14, "revisions"."sodium" AS t1_r15, "revisions"."carbohydrate" AS t1_r16, "revisions"."fiber" AS t1_r17, "revisions"."sugars" AS t1_r18, "revisions"."protein" AS t1_r19, "revisions"."format" AS t1_r20, "revisions"."pages" AS t1_r21, "revisions"."publisher" AS t1_r22, "revisions"."ingredients" AS t1_r23, "revisions"."image_url" AS t1_r24, "revisions"."brand_name" AS t1_r25, "revisions"."user_id" AS t1_r26, "revisions"."hit_id" AS t1_r27, "revisions"."worker_id" AS t1_r28, "revisions"."fat_calories" AS t1_r29, "revisions"."polyunsaturated_fat" AS t1_r30, "revisions"."monounsaturated_fat" AS t1_r31, "revisions"."potassium" AS t1_r32, "revisions"."visit_id" AS t1_r33, "revisions"."alcohol_by_volume" AS t1_r34 FROM "items" INNER JOIN "revisions" ON "revisions"."id" = "items"."current_revision_id" WHERE ("revisions"."name" IS NOT NULL) AND ("items"."gtin" != $1) ORDER BY LENGTH(gtin), gtin LIMIT $2 OFFSET $3 /*application:Datakick,controller:items,action:index*/