PgHero
No long running queries
Number of connections healthy 28
Vacuuming healthy
No columns near integer overflow
No invalid indexes
No duplicate indexes
No suggested indexes
6 slow queries

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
378 min 42% 39 ms 587,415 datakick
SELECT t.relname AS table, ix.relname AS name, regexp_replace(pg_get_indexdef(indexrelid), ?, ?) AS columns, regexp_replace(pg_get_indexdef(indexrelid), ?, ?) AS using, indisunique AS unique, indisprimary AS primary, indisvalid AS valid, indexprs::text, indpred::text, pg_get_indexdef(indexrelid) AS definition FROM pg_index i INNER JOIN pg_class t ON t.oid = i.indrelid INNER JOIN pg_class ix ON ix.oid = i.indexrelid ORDER BY 1, 2
120 min 13% 46 ms 155,410 datakick
SELECT schemaname AS schema, t.relname AS table, ix.relname AS name, regexp_replace(pg_get_indexdef(i.indexrelid), ?, ?) AS columns, regexp_replace(pg_get_indexdef(i.indexrelid), ?, ?) AS using, indisunique AS unique, indisprimary AS primary, indisvalid AS valid, indexprs::text, indpred::text, pg_get_indexdef(i.indexrelid) AS definition FROM pg_index i INNER JOIN pg_class t ON t.oid = i.indrelid INNER JOIN pg_class ix ON ix.oid = i.indexrelid LEFT JOIN pg_stat_user_indexes ui ON ui.indexrelid = i.indexrelid ORDER BY 1, 2
6 min 0.6% 672 ms 497 datakick
              SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
             (SELECT c.collname FROM pg_collation c, pg_type t
               WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation),
                     col_description(a.attrelid, a.attnum) AS comment
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = ?::regclass
                 AND a.attnum > ? AND NOT a.attisdropped
               ORDER BY a.attnum
1 min 0.1% 34 ms 2,182 datakick
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
1 min < 0.1% 32 ms 1,502 datakick
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 ? OFFSET ?
0 min < 0.1% 22 ms 708 datakick
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, "images"."id" AS t2_r0, "images"."image" AS t2_r1, "images"."created_at" AS t2_r2, "images"."updated_at" AS t2_r3, "images"."item_id" AS t2_r4, "images"."perspective" AS t2_r5, "images"."ip" AS t2_r6, "images"."user_agent" AS t2_r7, "images"."user_id" AS t2_r8 FROM "items" INNER JOIN "revisions" ON "revisions"."id" = "items"."current_revision_id" LEFT OUTER JOIN "images" ON "images"."item_id" = "items"."id" WHERE ("revisions"."name" IS NOT NULL) AND ("items"."gtin" != $1) AND "items"."id" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,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