explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fj4P

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 6,365.057 ↓ 10.0 20 1

Limit (cost=2,023.81..2,023.82 rows=2 width=1,718) (actual time=6,365.031..6,365.057 rows=20 loops=1)

2. 0.246 6,365.053 ↓ 10.0 20 1

Sort (cost=2,023.81..2,023.82 rows=2 width=1,718) (actual time=6,365.029..6,365.053 rows=20 loops=1)

  • Sort Key: users."connectedAt" DESC NULLS LAST
  • Sort Method: quicksort Memory: 73kB
3. 0.152 6,364.807 ↓ 16.0 32 1

Nested Loop Anti Join (cost=4.22..2,023.80 rows=2 width=1,718) (actual time=0.310..6,364.807 rows=32 loops=1)

4. 0.126 6,363.567 ↓ 16.0 32 1

Nested Loop Anti Join (cost=1.12..2,014.22 rows=2 width=1,718) (actual time=0.278..6,363.567 rows=32 loops=1)

5. 6,362.649 6,362.649 ↓ 16.5 33 1

Index Scan using "users_isConnected_idx2" on users (cost=0.56..2,008.08 rows=2 width=1,718) (actual time=0.252..6,362.649 rows=33 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 <> 5989364) AND ("nativeLanguageIds" && '{3,4,1}'::integer[]) AND ("selectedLearningLanguageIds" && '{29,2}'::integer[]) AND (NOT ("nativeLanguageIds" && '{6,25,48,15,87,13,101,109,110}'::integer[])) AND ((NOT ("blockedLanguageIds" && '{29,2}'::integer[])) OR ("blockedLanguageIds" IS NULL)) AND ("allowedMinAge" <= 16) AND ("allowedMaxAge" >= 16) AND (birthdate >= '2000-09-15 18:09:19+02'::timestamp with time zone) AND (birthdate <= '2007-09-15 18:09:19+02'::timestamp with time zone))
  • Rows Removed by Filter: 3,717
6. 0.792 0.792 ↓ 0.0 0 33

Index Only Scan using friends_userid_peerid_key on friends (cost=0.56..2.24 rows=1 width=4) (actual time=0.024..0.024 rows=0 loops=33)

  • Index Cond: (("userId" = users.id) AND ("peerId" = 5,989,364))
  • Heap Fetches: 1
7. 0.032 1.088 ↓ 0.0 0 32

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

  • Recheck Cond: ((("userId" = users.id) AND ("userBlockedId" = 5,989,364)) OR (("userId" = 5,989,364) AND ("userBlockedId" = users.id)))
8. 0.064 1.056 ↓ 0.0 0 32

BitmapOr (cost=3.10..3.10 rows=1 width=0) (actual time=0.033..0.033 rows=0 loops=32)

9. 0.416 0.416 ↓ 0.0 0 32

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

  • Index Cond: (("userId" = users.id) AND ("userBlockedId" = 5,989,364))
10. 0.576 0.576 ↓ 0.0 0 32

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

  • Index Cond: (("userId" = 5,989,364) AND ("userBlockedId" = users.id))
Planning time : 2.231 ms
Execution time : 6,365.271 ms