explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LW7

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

Nested Loop Left Join (cost=98.99..9,902.47 rows=100 width=48) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Function Scan on _subs (cost=0.01..1.00 rows=100 width=48) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Aggregate (cost=98.98..98.99 rows=1 width=32) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Limit (cost=49.00..98.97 rows=1 width=36) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=49.00..4,096.53 rows=81 width=36) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Index Scan Backward using messages_chat_id_platform_sequence_id_key on messages (cost=0.44..159.72 rows=81 width=17) (actual rows= loops=)

  • Index Cond: (chat_id = ((_subs.result_vars #>> '{query,chatId}'::text[]))::integer)
7. 0.000 0.000 ↓ 0.0

Aggregate (cost=48.56..48.57 rows=1 width=32) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Limit (cost=48.50..48.51 rows=4 width=36) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Sort (cost=48.50..48.59 rows=37 width=36) (actual rows= loops=)

  • Sort Key: suggestions.id
10. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=37.73..47.94 rows=37 width=36) (actual rows= loops=)

  • Hash Cond: (suggestions.suggestion_template_id = suggestion_templates.id)
11. 0.000 0.000 ↓ 0.0

Index Scan using idx_suggestions_message_id on suggestions (cost=0.43..10.08 rows=37 width=156) (actual rows= loops=)

  • Index Cond: (messages.id = message_id)
12. 0.000 0.000 ↓ 0.0

Hash (cost=27.55..27.55 rows=780 width=36) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on suggestion_templates (cost=0.00..27.55 rows=780 width=36) (actual rows= loops=)

14.          

SubPlan (for Seq Scan)

15. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=32) (actual rows= loops=)

16.          

SubPlan (for Hash Left Join)

17. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=32) (actual rows= loops=)

18.          

SubPlan (for Nested Loop Left Join)

19. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=32) (actual rows= loops=)