explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DnrJ

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

Delete on datavalue (cost=8,126,254.72..15,799,785.21 rows=81,655,072 width=34) (actual rows= loops=)

2.          

CTE to_delete

3. 0.000 0.000 ↓ 0.0

Hash Join (cost=342.27..7,533,543.43 rows=26,342,524 width=4) (actual rows= loops=)

  • Hash Cond: (dv.dataelementid = dse.dataelementid)
4. 0.000 0.000 ↓ 0.0

Seq Scan on datavalue dv (cost=0.00..6,227,015.76 rows=278,069,376 width=4) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash (cost=337.29..337.29 rows=399 width=8) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Join (cost=123.68..337.29 rows=399 width=8) (actual rows= loops=)

  • Hash Cond: (de.dataelementid = dse.dataelementid)
7. 0.000 0.000 ↓ 0.0

Index Only Scan using dataelement_pkey on dataelement de (cost=0.28..192.77 rows=4,566 width=4) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Hash (cost=118.41..118.41 rows=399 width=4) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash Join (cost=2.92..118.41 rows=399 width=4) (actual rows= loops=)

  • Hash Cond: (dse.datasetid = ds.datasetid)
10. 0.000 0.000 ↓ 0.0

Seq Scan on datasetelement dse (cost=0.00..89.82 rows=5,782 width=8) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash (cost=2.87..2.87 rows=4 width=4) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Seq Scan on dataset ds (cost=0.00..2.87 rows=4 width=4) (actual rows= loops=)

  • Filter: ((uid)::text = ANY ('{BpMbC0FJPkcm,kzug4nJpnis,jcaxCOQLeQC,Fo5ux0Ja21i}'::text[]))
13. 0.000 0.000 ↓ 0.0

Hash Join (cost=592,711.29..8,266,241.77 rows=81,655,072 width=34) (actual rows= loops=)

  • Hash Cond: (datavalue.dataelementid = to_delete.dataelementid)
14. 0.000 0.000 ↓ 0.0

Seq Scan on datavalue (cost=0.00..6,922,189.20 rows=163,310,145 width=10) (actual rows= loops=)

  • Filter: ((value)::text = '0'::text)
15. 0.000 0.000 ↓ 0.0

Hash (cost=592,708.79..592,708.79 rows=200 width=32) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

HashAggregate (cost=592,706.79..592,708.79 rows=200 width=32) (actual rows= loops=)

  • Group Key: to_delete.dataelementid
17. 0.000 0.000 ↓ 0.0

CTE Scan on to_delete (cost=0.00..526,850.48 rows=26,342,524 width=32) (actual rows= loops=)