explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1IA9

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 10,994.995 ↓ 2.9 20 1

Limit (cost=2,045.68..2,045.69 rows=7 width=1,718) (actual time=10,994.975..10,994.995 rows=20 loops=1)

2. 0.254 10,994.992 ↓ 2.9 20 1

Sort (cost=2,045.68..2,045.69 rows=7 width=1,718) (actual time=10,994.973..10,994.992 rows=20 loops=1)

  • Sort Key: users."connectedAt" DESC NULLS LAST
  • Sort Method: quicksort Memory: 54kB
3. 0.193 10,994.738 ↓ 3.1 22 1

Nested Loop Anti Join (cost=4.22..2,045.58 rows=7 width=1,718) (actual time=7.657..10,994.738 rows=22 loops=1)

4. 0.134 10,993.357 ↓ 3.1 22 1

Nested Loop Anti Join (cost=1.12..2,014.84 rows=7 width=1,718) (actual time=7.542..10,993.357 rows=22 loops=1)

5. 10,992.101 10,992.101 ↓ 3.1 22 1

Index Scan using "users_isConnected_idx2" on users (cost=0.56..2,000.67 rows=7 width=1,718) (actual time=7.438..10,992.101 rows=22 loops=1)

  • Index Cond: ("isConnected" = true)
  • Filter: (((NOT "androidAppUninstalled") OR "hasDesktopVersion" OR "hasIOSVersion") AND ("learningLanguageLevels" IS NOT NULL) AND ("learningLanguageIds" IS NOT NULL) AND "allowedNatives" AND "isInLiveChat" AND "allowedWomen" AND "isConnected" AND (NOT "isDeleted") AND (("jailScore" < 100) OR ("jailScore" IS NULL)) AND (("courtScore" < 300) OR ("courtScore" IS NULL)) AND (("cagibiScore" < 100) OR ("cagibiScore" IS NULL)) AND (id <> 6780228) AND ("nativeLanguageIds" && '{7}'::integer[]) AND ("selectedLearningLanguageIds" && '{1}'::integer[]) AND ("allowedMinAge" <= 26) AND ("allowedMaxAge" >= 26) AND (birthdate >= '1964-09-15 17:09:13+01'::timestamp with time zone) AND (birthdate <= '2007-09-15 18:09:13+02'::timestamp with time zone) AND (gender = 1))
  • Rows Removed by Filter: 3,718
6. 1.122 1.122 ↓ 0.0 0 22

Index Only Scan using friends_userid_peerid_key on friends (cost=0.56..1.84 rows=1 width=4) (actual time=0.051..0.051 rows=0 loops=22)

  • Index Cond: (("userId" = users.id) AND ("peerId" = 6,780,228))
  • Heap Fetches: 0
7. 0.044 1.188 ↓ 0.0 0 22

Bitmap Heap Scan on "blockedUsers" (cost=3.10..4.22 rows=1 width=8) (actual time=0.054..0.054 rows=0 loops=22)

  • Recheck Cond: ((("userId" = users.id) AND ("userBlockedId" = 6,780,228)) OR (("userId" = 6,780,228) AND ("userBlockedId" = users.id)))
8. 0.066 1.144 ↓ 0.0 0 22

BitmapOr (cost=3.10..3.10 rows=1 width=0) (actual time=0.052..0.052 rows=0 loops=22)

9. 0.924 0.924 ↓ 0.0 0 22

Bitmap Index Scan on "Blocked_users_id_user_id_user_blocked_key" (cost=0.00..1.55 rows=1 width=0) (actual time=0.042..0.042 rows=0 loops=22)

  • Index Cond: (("userId" = users.id) AND ("userBlockedId" = 6,780,228))
10. 0.154 0.154 ↓ 0.0 0 22

Bitmap Index Scan on "Blocked_users_id_user_id_user_blocked_key" (cost=0.00..1.55 rows=1 width=0) (actual time=0.007..0.007 rows=0 loops=22)

  • Index Cond: (("userId" = 6,780,228) AND ("userBlockedId" = users.id))
Planning time : 30.741 ms
Execution time : 10,995.322 ms