explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UkI3

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

Nested Loop Semi Join (cost=2.15..570.50 rows=1 width=5) (actual rows= loops=)

  • Join Filter: (t0.agid = t4.id)
2. 0.000 0.000 ↓ 0.0

Seq Scan on entity_group_map t0 (cost=0.00..1.54 rows=18 width=10) (actual rows= loops=)

  • Filter: (entity_type = ($1)::numeric)
3. 0.000 0.000 ↓ 0.0

Materialize (cost=2.15..568.69 rows=1 width=30) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.15..568.69 rows=1 width=30) (actual rows= loops=)

  • Join Filter: (t1.bodyid = t2.id)
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.87..568.34 rows=1 width=55) (actual rows= loops=)

  • Join Filter: (t4.id = t3.id)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.87..566.75 rows=1 width=50) (actual rows= loops=)

  • Join Filter: (wagm.agentid = t1.bodyid)
7. 0.000 0.000 ↓ 0.0

Index Scan using ixagrms on agent_ref t1 (cost=0.29..8.30 rows=1 width=5) (actual rows= loops=)

  • Index Cond: (((reference)::text = ($3)::text) AND (deleted = ($4)::numeric))
8. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.58..554.29 rows=333 width=45) (actual rows= loops=)

  • Hash Cond: (wagm.agid = t4.id)
9. 0.000 0.000 ↓ 0.0

Append (cost=0.00..520.21 rows=2,562 width=72) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on writable_agent_group_map wagm (cost=0.00..1.31 rows=31 width=15) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=1.52..518.59 rows=2,531 width=42) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.52..486.95 rows=2,531 width=14) (actual rows= loops=)

  • Hash Cond: (ab.tenant_id = ag.tenant_id)
  • Join Filter: (((ab.agent_category)::text = (ag.agent_category)::text) OR (ag.agent_category IS NULL))
13. 0.000 0.000 ↓ 0.0

Seq Scan on agent_body ab (cost=0.00..141.30 rows=4,830 width=19) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=1.46..1.46 rows=5 width=15) (actual rows= loops=)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.000 0.000 ↓ 0.0

Seq Scan on agent_group ag (cost=0.00..1.46 rows=5 width=15) (actual rows= loops=)

  • Filter: ((type = 1) AND ((id > '999'::numeric) OR (id = '1'::numeric)))
16. 0.000 0.000 ↓ 0.0

Hash (cost=1.26..1.26 rows=26 width=5) (actual rows= loops=)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
17. 0.000 0.000 ↓ 0.0

Seq Scan on agent_group t4 (cost=0.00..1.26 rows=26 width=5) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on agent_group t3 (cost=0.00..1.26 rows=26 width=5) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_agent_body on agent_body t2 (cost=0.28..0.33 rows=1 width=5) (actual rows= loops=)

  • Index Cond: (id = wagm.agentid)