explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NVYx

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.020 ↓ 0.0 0 1

Nested Loop Left Join (cost=17.90..102.07 rows=24 width=1,759) (actual time=0.020..0.020 rows=0 loops=1)

2. 0.000 0.020 ↓ 0.0 0 1

Nested Loop Left Join (cost=17.47..40.92 rows=24 width=1,405) (actual time=0.020..0.020 rows=0 loops=1)

3. 0.001 0.020 ↓ 0.0 0 1

Nested Loop (cost=17.18..33.42 rows=24 width=1,352) (actual time=0.020..0.020 rows=0 loops=1)

4. 0.000 0.019 ↓ 0.0 0 1

Nested Loop (cost=16.75..22.25 rows=24 width=998) (actual time=0.019..0.019 rows=0 loops=1)

5. 0.000 0.019 ↓ 0.0 0 1

Limit (cost=16.18..16.18 rows=1 width=953) (actual time=0.019..0.019 rows=0 loops=1)

6. 0.003 0.019 ↓ 0.0 0 1

Sort (cost=16.18..16.18 rows=1 width=953) (actual time=0.019..0.019 rows=0 loops=1)

  • Sort Key: "messagesMigration"."messageId
  • Sort Method: quicksort Memory: 25kB
7. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=1.86..16.17 rows=1 width=953) (actual time=0.016..0.016 rows=0 loops=1)

8. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=1.29..14.11 rows=1 width=490) (actual time=0.016..0.016 rows=0 loops=1)

9. 0.001 0.016 ↓ 0.0 0 1

Nested Loop (cost=0.85..12.19 rows=1 width=136) (actual time=0.016..0.016 rows=0 loops=1)

10. 0.015 0.015 ↓ 0.0 0 1

Index Scan using message_migration_idx on "messagesMigration" (cost=0.28..9.39 rows=1 width=57) (actual time=0.015..0.015 rows=0 loops=1)

  • Index Cond: (migrated = true)
  • Filter: (migrated AND ((SubPlan 1) IS NOT NULL))
11.          

SubPlan (for Index Scan)

12. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.15..7.51 rows=1 width=8) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=2.15..12.87 rows=2 width=8) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.72..10.30 rows=2 width=12) (never executed)

  • Join Filter: (message_1."conversationId" = "conversation->users"."conversationId")
15. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.15..5.59 rows=1 width=16) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Index Scan using messages_pkey on messages message_1 (cost=0.58..2.79 rows=1 width=12) (never executed)

  • Index Cond: (id = "messagesMigration"."messageId")
17. 0.000 0.000 ↓ 0.0 0

Index Only Scan using conversations_pkey on conversations conversation (cost=0.57..2.79 rows=1 width=4) (never executed)

  • Index Cond: (id = message_1."conversationId")
  • Heap Fetches: 0
18. 0.000 0.000 ↓ 0.0 0

Index Scan using conversation_users_conversation_id on "conversationUsers" "conversation->users" (cost=0.57..4.41 rows=24 width=8) (never executed)

  • Index Cond: ("conversationId" = conversation.id)
19. 0.000 0.000 ↓ 0.0 0

Index Only Scan using "Users_pkey" on users "conversation->users->user" (cost=0.43..1.28 rows=1 width=4) (never executed)

  • Index Cond: (id = "conversation->users"."userId")
  • Heap Fetches: 0
20. 0.000 0.000 ↓ 0.0 0

Index Scan using messages_pkey on messages message (cost=0.58..2.79 rows=1 width=79) (never executed)

  • Index Cond: (id = "messagesMigration"."messageId")
21. 0.000 0.000 ↓ 0.0 0

Index Scan using "Users_pkey" on users "message->user" (cost=0.43..1.90 rows=1 width=354) (never executed)

  • Index Cond: (id = message."userId")
22. 0.000 0.000 ↓ 0.0 0

Index Scan using conversations_pkey on conversations "message->conversation" (cost=0.57..2.05 rows=1 width=463) (never executed)

  • Index Cond: (id = message."conversationId")
23. 0.000 0.000 ↓ 0.0 0

Index Scan using conversation_users_conversation_id on "conversationUsers" "message->conversation->users" (cost=0.57..5.81 rows=24 width=45) (never executed)

  • Index Cond: ("conversationId" = "message->conversation".id)
24. 0.000 0.000 ↓ 0.0 0

Index Scan using "Users_pkey" on users "message->conversation->users->user" (cost=0.43..0.46 rows=1 width=354) (never executed)

  • Index Cond: (id = "message->conversation->users"."userId")
25. 0.000 0.000 ↓ 0.0 0

Index Scan using "usersMigration_pkey" on "usersMigration" "message->conversation->users->user->userMigration" (cost=0.29..0.30 rows=1 width=53) (never executed)

  • Index Cond: ("message->conversation->users->user".id = "userId")
26. 0.000 0.000 ↓ 0.0 0

Index Scan using "Users_pkey" on users "message->conversation->users->user->userMigration->user" (cost=0.43..2.54 rows=1 width=354) (never executed)

  • Index Cond: ("message->conversation->users->user->userMigration"."userId" = id)
Planning time : 3.727 ms
Execution time : 0.212 ms