explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9PBY

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 307.237 ↓ 2.9 20 1

Limit (cost=1,976.62..1,976.64 rows=7 width=1,718) (actual time=307.234..307.237 rows=20 loops=1)

2. 0.080 307.235 ↓ 2.9 20 1

Sort (cost=1,976.62..1,976.64 rows=7 width=1,718) (actual time=307.233..307.235 rows=20 loops=1)

  • Sort Key: users."connectedAt" DESC NULLS LAST
  • Sort Method: quicksort Memory: 54kB
3. 0.007 307.155 ↓ 3.3 23 1

Nested Loop Anti Join (cost=1,850.00..1,976.52 rows=7 width=1,718) (actual time=304.800..307.155 rows=23 loops=1)

4. 0.021 306.642 ↓ 3.3 23 1

Nested Loop Anti Join (cost=1,846.90..1,945.79 rows=7 width=1,718) (actual time=304.704..306.642 rows=23 loops=1)

5. 2.113 306.092 ↓ 3.3 23 1

Bitmap Heap Scan on users (cost=1,846.34..1,931.61 rows=7 width=1,718) (actual time=304.534..306.092 rows=23 loops=1)

  • Recheck Cond: ("nativeLanguageIds" && '{7}'::integer[])
  • 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: 83
  • Heap Blocks: exact=185
6. 2.608 303.979 ↓ 0.0 0 1

BitmapAnd (cost=1,846.34..1,846.34 rows=75 width=0) (actual time=303.979..303.979 rows=0 loops=1)

7. 179.593 179.593 ↓ 2.5 7,456 1

Bitmap Index Scan on "users_isConnected_idx2" (cost=0.00..412.23 rows=2,970 width=0) (actual time=179.593..179.593 rows=7,456 loops=1)

  • Index Cond: ("isConnected" = true)
8. 121.778 121.778 ↓ 2.0 329,379 1

Bitmap Index Scan on users_blocked_languages_idx (cost=0.00..1,433.85 rows=160,820 width=0) (actual time=121.778..121.778 rows=329,379 loops=1)

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

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

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

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

  • Recheck Cond: ((("userId" = users.id) AND ("userBlockedId" = 6,780,228)) OR (("userId" = 6,780,228) AND ("userBlockedId" = users.id)))
11. 0.000 0.483 ↓ 0.0 0 23

BitmapOr (cost=3.10..3.10 rows=1 width=0) (actual time=0.021..0.021 rows=0 loops=23)

12. 0.437 0.437 ↓ 0.0 0 23

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

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

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

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