explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DG7l

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

Nested Loop Semi Join (cost=2.15..312.84 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..311.03 rows=1 width=30) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.15..311.03 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..310.67 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..309.09 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.28..21.17 rows=1 width=5) (actual rows= loops=)

  • Index Cond: (((reference)::text = ANY ((ARRAY[$3, $4, $5, $6])::text[])) AND (deleted = ($7)::numeric))
8. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.58..286.16 rows=140 width=45) (actual rows= loops=)

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

Append (cost=0.00..270.91 rows=1,078 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..269.29 rows=1,047 width=42) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.52..256.20 rows=1,047 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..112.90 rows=1,990 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.35 rows=1 width=5) (actual rows= loops=)

  • Index Cond: (id = wagm.agentid)