explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Usfg

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 5.203 ↑ 1.0 1 1

Nested Loop Semi Join (cost=31.20..321.47 rows=1 width=5) (actual time=5.199..5.203 rows=1 loops=1)

  • Join Filter: (t0.agid = t4.id)
  • Rows Removed by Join Filter: 22
  • Buffers: shared hit=140
2. 0.010 0.010 ↑ 1.0 4 1

Seq Scan on entity_group_map t0 (cost=0.00..1.45 rows=4 width=10) (actual time=0.008..0.010 rows=4 loops=1)

  • Filter: (entity_type = '6'::numeric)
  • Rows Removed by Filter: 32
  • Buffers: shared hit=1
3. 0.003 5.184 ↓ 6.0 6 4

Materialize (cost=31.20..319.97 rows=1 width=30) (actual time=0.090..1.296 rows=6 loops=4)

  • Buffers: shared hit=139
4. 0.008 5.181 ↓ 6.0 6 1

Nested Loop (cost=31.20..319.96 rows=1 width=30) (actual time=0.356..5.181 rows=6 loops=1)

  • Join Filter: (t1.bodyid = t2.id)
  • Buffers: shared hit=139
5. 0.010 5.143 ↓ 6.0 6 1

Nested Loop (cost=30.92..319.59 rows=1 width=55) (actual time=0.330..5.143 rows=6 loops=1)

  • Join Filter: (t4.id = t3.id)
  • Buffers: shared hit=124
6. 0.006 5.127 ↓ 6.0 6 1

Nested Loop (cost=30.78..319.42 rows=1 width=50) (actual time=0.322..5.127 rows=6 loops=1)

  • Buffers: shared hit=117
7. 0.441 5.097 ↓ 3.0 6 1

Hash Join (cost=30.64..319.09 rows=2 width=45) (actual time=0.300..5.097 rows=6 loops=1)

  • Hash Cond: (wagm.agentid = t1.bodyid)
  • Buffers: shared hit=110
8. 0.306 4.606 ↓ 3.7 4,011 1

Append (cost=0.00..270.91 rows=1,078 width=72) (actual time=0.003..4.606 rows=4,011 loops=1)

  • Buffers: shared hit=95
9. 0.005 0.005 ↑ 1.0 31 1

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

  • Buffers: shared hit=1
10. 0.603 4.295 ↓ 3.8 3,980 1

Subquery Scan on *SELECT* 2 (cost=1.52..269.29 rows=1,047 width=42) (actual time=0.034..4.295 rows=3,980 loops=1)

  • Buffers: shared hit=94
11. 3.472 3.692 ↓ 3.8 3,980 1

Hash Join (cost=1.52..256.20 rows=1,047 width=14) (actual time=0.031..3.692 rows=3,980 loops=1)

  • Hash Cond: (ab.tenant_id = ag.tenant_id)
  • Join Filter: (((ab.agent_category)::text = (ag.agent_category)::text) OR (ag.agent_category IS NULL))
  • Rows Removed by Join Filter: 15,920
  • Buffers: shared hit=94
12. 0.204 0.204 ↑ 1.0 1,990 1

Seq Scan on agent_body ab (cost=0.00..112.90 rows=1,990 width=19) (actual time=0.003..0.204 rows=1,990 loops=1)

  • Buffers: shared hit=93
13. 0.006 0.016 ↓ 2.0 10 1

Hash (cost=1.46..1.46 rows=5 width=15) (actual time=0.016..0.016 rows=10 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
14. 0.010 0.010 ↓ 2.0 10 1

Seq Scan on agent_group ag (cost=0.00..1.46 rows=5 width=15) (actual time=0.006..0.010 rows=10 loops=1)

  • Filter: ((type = 1) AND ((id > '999'::numeric) OR (id = '1'::numeric)))
  • Rows Removed by Filter: 16
  • Buffers: shared hit=1
15. 0.003 0.050 ↑ 1.3 3 1

Hash (cost=30.59..30.59 rows=4 width=5) (actual time=0.050..0.050 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=12
16. 0.047 0.047 ↑ 1.3 3 1

Index Scan using ixagrms on agent_ref t1 (cost=0.28..30.59 rows=4 width=5) (actual time=0.035..0.047 rows=3 loops=1)

  • Index Cond: (((reference)::text = ANY ('{97800052,97800052,97900052,airtime}'::text[])) AND (deleted = '0'::numeric))
  • Buffers: shared hit=12
17. 0.024 0.024 ↑ 1.0 1 6

Index Only Scan using pk_agent_group on agent_group t4 (cost=0.14..0.16 rows=1 width=5) (actual time=0.004..0.004 rows=1 loops=6)

  • Index Cond: (id = wagm.agid)
  • Heap Fetches: 0
  • Buffers: shared hit=7
18. 0.006 0.006 ↑ 1.0 1 6

Index Only Scan using pk_agent_group on agent_group t3 (cost=0.14..0.16 rows=1 width=5) (actual time=0.001..0.001 rows=1 loops=6)

  • Index Cond: (id = wagm.agid)
  • Heap Fetches: 0
  • Buffers: shared hit=7
19. 0.030 0.030 ↑ 1.0 1 6

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

  • Index Cond: (id = wagm.agentid)
  • Heap Fetches: 2
  • Buffers: shared hit=15