explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g00i

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 2,444.979 ↓ 1.9 13 1

Limit (cost=1,933.72..1,933.74 rows=7 width=1,718) (actual time=2,444.973..2,444.979 rows=13 loops=1)

2. 0.075 2,444.975 ↓ 1.9 13 1

Sort (cost=1,933.72..1,933.74 rows=7 width=1,718) (actual time=2,444.971..2,444.975 rows=13 loops=1)

  • Sort Key: users."connectedAt" DESC NULLS LAST
  • Sort Method: quicksort Memory: 41kB
3. 0.043 2,444.900 ↓ 1.9 13 1

Nested Loop Anti Join (cost=1,807.10..1,933.62 rows=7 width=1,718) (actual time=2,443.137..2,444.900 rows=13 loops=1)

4. 1.043 2,444.649 ↓ 1.9 13 1

Nested Loop Anti Join (cost=1,804.00..1,902.89 rows=7 width=1,718) (actual time=2,443.067..2,444.649 rows=13 loops=1)

5. 1,025.223 2,443.424 ↓ 1.9 13 1

Bitmap Heap Scan on users (cost=1,803.44..1,888.71 rows=7 width=1,718) (actual time=2,442.016..2,443.424 rows=13 loops=1)

  • Recheck Cond: ("nativeLanguageIds" && '{7}'::integer[])
  • Rows Removed by Index Recheck: 76,502
  • 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 ("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: 16,523
  • Heap Blocks: exact=16,544 lossy=34,981
6. 250.260 1,418.201 ↓ 0.0 0 1

BitmapAnd (cost=1,803.44..1,803.44 rows=75 width=0) (actual time=1,418.201..1,418.201 rows=0 loops=1)

7. 787.125 787.125 ↓ 343.9 1,021,327 1

Bitmap Index Scan on "users_isConnected_idx2" (cost=0.00..411.13 rows=2,970 width=0) (actual time=787.125..787.125 rows=1,021,327 loops=1)

  • Index Cond: ("isConnected" = true)
8. 380.816 380.816 ↓ 2.0 323,423 1

Bitmap Index Scan on users_blocked_languages_idx (cost=0.00..1,392.05 rows=160,820 width=0) (actual time=380.816..380.816 rows=323,423 loops=1)

  • Index Cond: ("nativeLanguageIds" && '{7}'::integer[])
9. 0.182 0.182 ↓ 0.0 0 13

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

  • Index Cond: (("userId" = users.id) AND ("peerId" = 6,780,228))
  • Heap Fetches: 0
10. 0.000 0.208 ↓ 0.0 0 13

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

  • Recheck Cond: ((("userId" = users.id) AND ("userBlockedId" = 6,780,228)) OR (("userId" = 6,780,228) AND ("userBlockedId" = users.id)))
11. 0.039 0.208 ↓ 0.0 0 13

BitmapOr (cost=3.10..3.10 rows=1 width=0) (actual time=0.016..0.016 rows=0 loops=13)

12. 0.130 0.130 ↓ 0.0 0 13

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

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

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

  • Index Cond: (("userId" = 6,780,228) AND ("userBlockedId" = users.id))
Planning time : 2.099 ms
Execution time : 2,445.208 ms