explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 88ij

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

Hash Left Join (cost=212,886.51..225,023.17 rows=83 width=1,676) (actual time=1.308..1.308 rows=0 loops=1)

  • Hash Cond: (c.parent_unit_id = d.id)
2. 0.000 1.307 ↓ 0.0 0 1

Hash Left Join (cost=212,868.64..224,997.52 rows=83 width=1,201) (actual time=1.307..1.307 rows=0 loops=1)

  • Hash Cond: (b.parent_unit_id = c.id)
3. 0.000 1.307 ↓ 0.0 0 1

Hash Left Join (cost=212,850.76..224,978.71 rows=83 width=1,192) (actual time=1.307..1.307 rows=0 loops=1)

  • Hash Cond: (a.parent_unit_id = b.id)
4. 0.000 1.307 ↓ 0.0 0 1

Merge Left Join (cost=212,832.89..224,959.91 rows=83 width=1,183) (actual time=1.307..1.307 rows=0 loops=1)

  • Merge Cond: (stop_values.stop_id = tickets_crosstab.stop_id)
  • Join Filter: (tickets_crosstab.client_day = stop_values.client_day)
5. 0.002 1.307 ↓ 0.0 0 1

Nested Loop Left Join (cost=522.36..8,815.84 rows=83 width=1,119) (actual time=1.307..1.307 rows=0 loops=1)

  • Join Filter: ((targets.client_day = stop_values.client_day) AND (targets.item_id = lookup.production_id))
6. 0.000 1.305 ↓ 0.0 0 1

Merge Left Join (cost=522.36..528.88 rows=83 width=1,121) (actual time=1.305..1.305 rows=0 loops=1)

  • Merge Cond: (stop_values.stop_id = stop_header.stop_id)
7. 0.013 1.305 ↓ 0.0 0 1

Sort (cost=433.56..433.77 rows=83 width=1,113) (actual time=1.305..1.305 rows=0 loops=1)

  • Sort Key: stop_values.stop_id
  • Sort Method: quicksort Memory: 25kB
8. 0.012 1.292 ↓ 0.0 0 1

Hash Join (cost=244.14..430.92 rows=83 width=1,113) (actual time=1.292..1.292 rows=0 loops=1)

  • Hash Cond: (stops.route_id = routes.id)
9. 0.020 1.217 ↓ 0.0 0 1

Hash Join (cost=223.51..409.14 rows=83 width=1,084) (actual time=1.217..1.217 rows=0 loops=1)

  • Hash Cond: (stop_values.stop_id = stops.id)
10. 0.013 0.024 ↓ 0.0 0 1

Hash Right Join (cost=134.12..318.61 rows=83 width=1,049) (actual time=0.023..0.024 rows=0 loops=1)

  • Hash Cond: (items.id = lookup.well_id)
11. 0.000 0.000 ↓ 0.0 0

Seq Scan on items (cost=0.00..167.70 rows=4,270 width=175) (never executed)

12. 0.002 0.011 ↓ 0.0 0 1

Hash (cost=133.08..133.08 rows=83 width=890) (actual time=0.011..0.011 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
13. 0.000 0.009 ↓ 0.0 0 1

Hash Join (cost=34.55..133.08 rows=83 width=890) (actual time=0.009..0.009 rows=0 loops=1)

  • Hash Cond: (stop_values.stop_id = lookup.stop_id)
14. 0.009 0.009 ↓ 0.0 0 1

Index Scan using batch_id_daily_stop_values_backing on daily_stop_values_backing stop_values (cost=0.43..97.72 rows=83 width=842) (actual time=0.009..0.009 rows=0 loops=1)

  • Index Cond: (batch_id = '61fbd3d3-22c0-428d-9915-26142e288e2f'::uuid)
15. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.72..20.72 rows=1,072 width=48) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Seq Scan on production_item lookup (cost=0.00..20.72 rows=1,072 width=48) (never executed)

17. 0.540 1.173 ↑ 1.0 1,049 1

Hash (cost=76.06..76.06 rows=1,066 width=67) (actual time=1.173..1.173 rows=1,049 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 117kB
18. 0.633 0.633 ↑ 1.0 1,049 1

Seq Scan on stops (cost=0.00..76.06 rows=1,066 width=67) (actual time=0.013..0.633 rows=1,049 loops=1)

  • Filter: ((deleted)::text <> 'true'::text)
  • Rows Removed by Filter: 22
19. 0.007 0.063 ↑ 1.0 21 1

Hash (cost=20.37..20.37 rows=21 width=61) (actual time=0.063..0.063 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
20. 0.032 0.056 ↑ 1.0 21 1

Hash Left Join (cost=17.88..20.37 rows=21 width=61) (actual time=0.035..0.056 rows=21 loops=1)

  • Hash Cond: (routes.organization_unit_id = a.id)
21. 0.012 0.012 ↑ 1.0 21 1

Seq Scan on routes (cost=0.00..2.21 rows=21 width=52) (actual time=0.006..0.012 rows=21 loops=1)

22. 0.007 0.012 ↑ 87.5 4 1

Hash (cost=13.50..13.50 rows=350 width=41) (actual time=0.012..0.012 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
23. 0.005 0.005 ↑ 87.5 4 1

Seq Scan on stg_organization_units a (cost=0.00..13.50 rows=350 width=41) (actual time=0.004..0.005 rows=4 loops=1)

24. 0.000 0.000 ↓ 0.0 0

Sort (cost=88.80..91.44 rows=1,059 width=24) (never executed)

  • Sort Key: stop_header.stop_id
25. 0.000 0.000 ↓ 0.0 0

Seq Scan on stop_headers stop_header (cost=0.00..35.59 rows=1,059 width=24) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..8,285.52 rows=1 width=34) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Seq Scan on targets (cost=0.00..8,285.51 rows=1 width=34) (never executed)

  • Filter: (target_type_code = 1)
28. 0.000 0.000 ↓ 0.0 0

Materialize (cost=212,310.52..216,136.38 rows=1,985 width=84) (never executed)

29. 0.000 0.000 ↓ 0.0 0

GroupAggregate (cost=212,310.52..216,111.57 rows=1,985 width=84) (never executed)

  • Group Key: tickets_crosstab.stop_id, tickets_crosstab.client_day
30. 0.000 0.000 ↓ 0.0 0

GroupAggregate (cost=212,310.52..215,684.83 rows=19,848 width=116) (never executed)

  • Group Key: tickets_crosstab.stop_id, tickets_crosstab.client_day, ((forms.product)::text)
31. 0.000 0.000 ↓ 0.0 0

Sort (cost=212,310.52..212,558.64 rows=99,245 width=68) (never executed)

  • Sort Key: tickets_crosstab.stop_id, tickets_crosstab.client_day, ((forms.product)::text)
32. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=5,028.01..199,999.83 rows=99,245 width=68) (never executed)

  • Hash Cond: (forms.id = tickets_crosstab.form_id)
33. 0.000 0.000 ↓ 0.0 0

Seq Scan on forms_historical forms (cost=0.00..128,965.65 rows=4,114,265 width=20) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Hash (cost=2,914.45..2,914.45 rows=99,245 width=48) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Seq Scan on tickets_crosstab (cost=0.00..2,914.45 rows=99,245 width=48) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Hash (cost=13.50..13.50 rows=350 width=41) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Seq Scan on stg_organization_units b (cost=0.00..13.50 rows=350 width=41) (never executed)

38. 0.000 0.000 ↓ 0.0 0

Hash (cost=13.50..13.50 rows=350 width=41) (never executed)

39. 0.000 0.000 ↓ 0.0 0

Seq Scan on stg_organization_units c (cost=0.00..13.50 rows=350 width=41) (never executed)

40. 0.000 0.000 ↓ 0.0 0

Hash (cost=13.50..13.50 rows=350 width=25) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Seq Scan on stg_organization_units d (cost=0.00..13.50 rows=350 width=25) (never executed)

Planning time : 16.130 ms