explain.depesz.com

PostgreSQL's explain analyze made readable

Result: giY

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 37.778 ↓ 0.0 0 1

Delete on permissions_device p (cost=52,445.25..64,637.03 rows=1,543 width=44) (actual time=37.778..37.778 rows=0 loops=1)

2. 0.002 37.777 ↓ 0.0 0 1

Nested Loop (cost=52,445.25..64,637.03 rows=1,543 width=44) (actual time=37.777..37.777 rows=0 loops=1)

3. 0.002 37.775 ↓ 0.0 0 1

HashAggregate (cost=52,444.82..52,460.25 rows=1,543 width=42) (actual time=37.775..37.775 rows=0 loops=1)

  • Group Key: t.id
4. 0.576 37.773 ↓ 0.0 0 1

Hash Anti Join (cost=46,719.30..52,440.96 rows=1,543 width=42) (actual time=37.773..37.773 rows=0 loops=1)

  • Hash Cond: ((t.user_id = p_1.user_id) AND (t.device_id = p_1.device_id))
5. 0.501 0.598 ↑ 1.2 1,664 1

Bitmap Heap Scan on permissions_device t (cost=37.11..5,587.47 rows=2,057 width=18) (actual time=0.108..0.598 rows=1,664 loops=1)

  • Recheck Cond: (NOT is_implicit)
  • Heap Blocks: exact=10
6. 0.097 0.097 ↑ 1.2 1,664 1

Bitmap Index Scan on ix_tmp (cost=0.00..36.60 rows=2,057 width=0) (actual time=0.097..0.097 rows=1,664 loops=1)

7. 0.517 36.599 ↓ 1.5 1,664 1

Hash (cost=46,665.30..46,665.30 rows=1,126 width=40) (actual time=36.599..36.599 rows=1,664 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 133kB
8. 0.817 36.082 ↓ 1.5 1,664 1

Subquery Scan on p_1 (cost=46,642.78..46,665.30 rows=1,126 width=40) (actual time=34.780..36.082 rows=1,664 loops=1)

9. 4.075 35.265 ↓ 1.5 1,664 1

HashAggregate (cost=46,642.78..46,654.04 rows=1,126 width=8) (actual time=34.774..35.265 rows=1,664 loops=1)

  • Group Key: p_2.user_id, p_2.device_id
10. 31.190 31.190 ↑ 1.1 8,875 1

Seq Scan on permissions p_2 (cost=0.00..46,595.52 rows=9,452 width=8) (actual time=0.003..31.190 rows=8,875 loops=1)

11. 0.000 0.000 ↓ 0.0 0

Index Scan using permissions_device_pkey on permissions_device p (cost=0.43..7.88 rows=1 width=10) (never executed)

  • Index Cond: (id = t.id)