explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YjE8

Settings
# exclusive inclusive rows x rows loops node
1. 0.126 126.630 ↑ 1.0 1,000 1

Limit (cost=1.14..197,708.84 rows=1,000 width=468) (actual time=0.112..126.630 rows=1,000 loops=1)

2. 0.567 126.504 ↑ 9.9 1,000 1

Nested Loop (cost=1.14..1,967,192.74 rows=9,950 width=468) (actual time=0.111..126.504 rows=1,000 loops=1)

3. 0.836 124.937 ↑ 9.9 1,000 1

Nested Loop (cost=0.86..1,963,848.04 rows=9,950 width=411) (actual time=0.109..124.937 rows=1,000 loops=1)

4. 0.745 123.101 ↑ 9.9 1,000 1

Nested Loop (cost=0.57..1,957,442.85 rows=9,950 width=159) (actual time=0.106..123.101 rows=1,000 loops=1)

5. 0.356 121.356 ↑ 9.9 1,000 1

Index Scan using "messagesMigration_pkey" on "messagesMigration" (cost=0.29..1,952,489.48 rows=9,950 width=43) (actual time=0.104..121.356 rows=1,000 loops=1)

  • Filter: ((NOT migrated) AND ((SubPlan 1) IS NOT NULL))
6.          

SubPlan (for Index Scan)

7. 1.000 121.000 ↑ 1.0 1 1,000

Limit (cost=8.88..195.17 rows=1 width=8) (actual time=0.120..0.121 rows=1 loops=1,000)

8. 0.000 120.000 ↑ 2.0 1 1,000

Nested Loop (cost=8.88..381.46 rows=2 width=8) (actual time=0.120..0.120 rows=1 loops=1,000)

9. 2.000 119.000 ↑ 2.0 1 1,000

Nested Loop (cost=8.60..380.79 rows=2 width=12) (actual time=0.119..0.119 rows=1 loops=1,000)

  • Join Filter: (message_1."conversationId" = conversation.id)
10. 50.000 116.000 ↑ 2.0 1 1,000

Hash Join (cost=8.31..380.15 rows=2 width=20) (actual time=0.116..0.116 rows=1 loops=1,000)

  • Hash Cond: ("conversation->users"."conversationId" = message_1."conversationId")
11. 64.000 64.000 ↑ 13.8 741 1,000

Seq Scan on "conversationUsers" "conversation->users" (cost=0.00..333.41 rows=10,241 width=8) (actual time=0.001..0.064 rows=741 loops=1,000)

12. 1.000 2.000 ↑ 1.0 1 1,000

Hash (cost=8.30..8.30 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=1,000)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 1.000 1.000 ↑ 1.0 1 1,000

Index Scan using messages_pkey on messages message_1 (cost=0.29..8.30 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=1,000)

  • Index Cond: (id = "messagesMigration"."messageId")
14. 1.000 1.000 ↑ 1.0 1 1,000

Index Only Scan using conversations_pkey on conversations conversation (cost=0.28..0.31 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1,000)

  • Index Cond: (id = "conversation->users"."conversationId")
  • Heap Fetches: 0
15. 1.000 1.000 ↑ 1.0 1 1,000

Index Only Scan using users_pkey on users "conversation->users->user" (cost=0.29..0.33 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1,000)

  • Index Cond: (id = "conversation->users"."userId")
  • Heap Fetches: 0
16. 1.000 1.000 ↑ 1.0 1 1,000

Index Scan using messages_pkey on messages message (cost=0.29..0.49 rows=1 width=116) (actual time=0.001..0.001 rows=1 loops=1,000)

  • Index Cond: (id = "messagesMigration"."messageId")
17. 1.000 1.000 ↑ 1.0 1 1,000

Index Scan using users_pkey on users "message->user" (cost=0.29..0.63 rows=1 width=252) (actual time=0.001..0.001 rows=1 loops=1,000)

  • Index Cond: (id = message."userId")
18. 1.000 1.000 ↑ 1.0 1 1,000

Index Scan using conversations_pkey on conversations "message->conversation" (cost=0.28..0.33 rows=1 width=57) (actual time=0.001..0.001 rows=1 loops=1,000)

  • Index Cond: (id = message."conversationId")
Planning time : 0.597 ms
Execution time : 126.806 ms