PgHero
No long running queries
Connections healthy 37
Vacuuming healthy
No columns near integer overflow
No invalid indexes
No duplicate indexes
1 suggested index
3 slow queries

Suggested Indexes

Add indexes to speed up queries. Here’s a migration to help.


Details
CREATE INDEX CONCURRENTLY ON tweets (query_id, retweet_count)

to speed up

Total Time Average Time Calls
1 min 47% 27 ms 1,408 project_n · details
SELECT SUM("tweets"."retweet_count") AS sum_retweet_count, "tweets"."screen_name" AS tweets_screen_name FROM "tweets" WHERE "tweets"."query_id" = $1 AND "tweets"."retweet" = $2 AND (retweet_count > $3) GROUP BY "tweets"."screen_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
1 min 47% 27 ms 1,408 project_n · details
SELECT SUM("tweets"."retweet_count") AS sum_retweet_count, "tweets"."screen_name" AS tweets_screen_name FROM "tweets" WHERE "tweets"."query_id" = $1 AND "tweets"."retweet" = $2 AND (retweet_count > $3) GROUP BY "tweets"."screen_name"
Details
CREATE INDEX CONCURRENTLY ON tweets (query_id, retweet_count)
0 min 11% 53 ms 166 project_n · details
SELECT COUNT(*) FROM "tweets" WHERE "tweets"."query_id" = $1 AND "tweets"."retweet" = $2
0 min 6% 28 ms 165 project_n · details
SELECT  twitter_id, created_at, screen_name, user_image_url, user_followers_count, text, retweet_count, favorite_count, document FROM "tweets" WHERE "tweets"."query_id" = $1 AND "tweets"."retweet" = $2  ORDER BY created_at desc LIMIT 200 OFFSET 0