explain.depesz.com

PostgreSQL's explain analyze made readable

Result: W2d

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 26.793 ↑ 2.7 23 1

Append (cost=109.73..202.64 rows=63 width=32) (actual time=26.206..26.793 rows=23 loops=1)

2. 0.323 26.770 ↓ 1.9 23 1

Unique (cost=109.73..109.79 rows=12 width=32) (actual time=26.205..26.770 rows=23 loops=1)

3. 2.614 26.447 ↓ 335.3 4,024 1

Sort (cost=109.73..109.76 rows=12 width=32) (actual time=26.204..26.447 rows=4,024 loops=1)

  • Sort Key: ((((((container_sizes.container_size)::text || ' ('::text) || (container_types.container_type)::text) || ') '::text) || (container_classes.container_class)::text))
  • Sort Method: quicksort Memory: 372kB
4. 8.568 23.833 ↓ 335.3 4,024 1

Nested Loop (cost=46.28..109.51 rows=12 width=32) (actual time=2.904..23.833 rows=4,024 loops=1)

5. 0.612 11.241 ↓ 335.3 1,006 1

Nested Loop (cost=46.14..108.28 rows=3 width=76) (actual time=2.876..11.241 rows=1,006 loops=1)

6. 0.357 9.623 ↓ 335.3 1,006 1

Nested Loop Left Join (cost=46.01..107.78 rows=3 width=56) (actual time=2.870..9.623 rows=1,006 loops=1)

  • Filter: ((NOT ss.uses_subcontractors_skips) OR (ss.uses_subcontractors_skips IS NULL))
7. 0.488 8.260 ↓ 167.7 1,006 1

Nested Loop (cost=45.88..106.84 rows=6 width=60) (actual time=2.863..8.260 rows=1,006 loops=1)

8. 0.749 3.748 ↓ 143.7 1,006 1

Hash Join (cost=45.46..65.36 rows=7 width=60) (actual time=2.820..3.748 rows=1,006 loops=1)

  • Hash Cond: (cos.container_id_out = containers.container_id)
9. 0.226 0.226 ↑ 1.0 1,006 1

Seq Scan on containers_on_site cos (cost=0.00..16.06 rows=1,006 width=8) (actual time=0.028..0.226 rows=1,006 loops=1)

10. 0.372 2.773 ↓ 137.8 1,653 1

Hash (cost=45.31..45.31 rows=12 width=60) (actual time=2.773..2.773 rows=1,653 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 130kB
11. 0.577 2.401 ↓ 137.8 1,653 1

Hash Join (cost=2.65..45.31 rows=12 width=60) (actual time=0.047..2.401 rows=1,653 loops=1)

  • Hash Cond: ((containers.container_class_id = container_types.container_class_id) AND (containers.container_type_id = container_types.container_type_id))
12. 1.645 1.811 ↓ 18.0 1,653 1

Hash Join (cost=1.45..43.30 rows=92 width=28) (actual time=0.027..1.811 rows=1,653 loops=1)

  • Hash Cond: ((containers.container_size_id = container_sizes.container_size_id) AND (containers.container_class_id = container_sizes.container_class_id))
13. 0.154 0.154 ↑ 1.0 1,653 1

Seq Scan on containers (cost=0.00..28.53 rows=1,653 width=16) (actual time=0.007..0.154 rows=1,653 loops=1)

14. 0.003 0.012 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=12) (actual time=0.012..0.012 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.009 0.009 ↑ 1.0 18 1

Seq Scan on container_sizes (cost=0.00..1.18 rows=18 width=12) (actual time=0.006..0.009 rows=18 loops=1)

16. 0.005 0.013 ↑ 1.0 8 1

Hash (cost=1.08..1.08 rows=8 width=40) (actual time=0.013..0.013 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.008 0.008 ↑ 1.0 8 1

Seq Scan on container_types (cost=0.00..1.08 rows=8 width=40) (actual time=0.007..0.008 rows=8 loops=1)

18. 4.024 4.024 ↑ 1.0 1 1,006

Index Scan using orders_pkey on orders o (cost=0.42..5.92 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=1,006)

  • Index Cond: (order_id = cos.order_id)
  • Filter: ((subcontractor_id = 0) OR (subcontractor_id IS NULL))
19. 1.006 1.006 ↓ 0.0 0 1,006

Index Scan using subcontracted_skips_order_id on subcontracted_skips ss (cost=0.13..0.15 rows=1 width=5) (actual time=0.001..0.001 rows=0 loops=1,006)

  • Index Cond: (o.order_parent_id = order_id)
20. 1.006 1.006 ↑ 1.0 1 1,006

Index Scan using container_classes_pkey on container_classes (cost=0.13..0.15 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=1,006)

  • Index Cond: (container_class_id = containers.container_class_id)
21. 4.024 4.024 ↑ 1.0 4 1,006

Index Scan using vehicle_type_accepts_container_size_id_idx on vehicle_type_accepts vta (cost=0.14..0.31 rows=4 width=4) (actual time=0.001..0.004 rows=4 loops=1,006)

  • Index Cond: (container_size_id = containers.container_size_id)
  • Filter: (vehicle_type_id = 2)
  • Rows Removed by Filter: 6
22. 0.002 0.020 ↓ 0.0 0 1

HashAggregate (cost=90.94..92.22 rows=51 width=32) (actual time=0.020..0.020 rows=0 loops=1)

  • Group Key: (((((container_sizes_1.container_size)::text || ' ('::text) || (container_types_1.container_type)::text) || ') '::text) || (container_classes_1.container_class)::text)
23. 0.000 0.018 ↓ 0.0 0 1

Nested Loop (cost=45.75..90.82 rows=51 width=32) (actual time=0.018..0.018 rows=0 loops=1)

24. 0.001 0.018 ↓ 0.0 0 1

Nested Loop Left Join (cost=45.60..85.47 rows=13 width=76) (actual time=0.018..0.018 rows=0 loops=1)

  • Filter: ((bin_contract_containers.sub_service_types <> '{7001,7002,7006,7007,7100,7005,7009,7200}'::smallint[]) OR (bin_contract_containers.sub_service_types IS NULL))
25. 0.000 0.017 ↓ 0.0 0 1

Nested Loop (cost=45.46..82.86 rows=13 width=80) (actual time=0.017..0.017 rows=0 loops=1)

  • Join Filter: (containers_1.container_class_id = container_classes_1.container_class_id)
26. 0.000 0.017 ↓ 0.0 0 1

Hash Join (cost=45.46..81.03 rows=13 width=60) (actual time=0.017..0.017 rows=0 loops=1)

  • Hash Cond: (bs.container_id = containers_1.container_id)
27. 0.017 0.017 ↓ 0.0 0 1

Seq Scan on bins_on_site bs (cost=0.00..28.50 rows=1,850 width=8) (actual time=0.017..0.017 rows=0 loops=1)

28. 0.000 0.000 ↓ 0.0 0

Hash (cost=45.31..45.31 rows=12 width=60) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=2.65..45.31 rows=12 width=60) (never executed)

  • Hash Cond: ((containers_1.container_class_id = container_types_1.container_class_id) AND (containers_1.container_type_id = container_types_1.container_type_id))
30. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1.45..43.30 rows=92 width=28) (never executed)

  • Hash Cond: ((containers_1.container_size_id = container_sizes_1.container_size_id) AND (containers_1.container_class_id = container_sizes_1.container_class_id))
31. 0.000 0.000 ↓ 0.0 0

Seq Scan on containers containers_1 (cost=0.00..28.53 rows=1,653 width=16) (never executed)

32. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.18..1.18 rows=18 width=12) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Seq Scan on container_sizes container_sizes_1 (cost=0.00..1.18 rows=18 width=12) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.08..1.08 rows=8 width=40) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Seq Scan on container_types container_types_1 (cost=0.00..1.08 rows=8 width=40) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.06 rows=4 width=36) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Seq Scan on container_classes container_classes_1 (cost=0.00..1.04 rows=4 width=36) (never executed)

38. 0.000 0.000 ↓ 0.0 0

Index Scan using bin_contract_container_pkey on bin_contract_containers (cost=0.15..0.19 rows=1 width=36) (never executed)

  • Index Cond: (bs.bin_contract_container_id = bin_contract_container_id)
39. 0.000 0.000 ↓ 0.0 0

Index Scan using vehicle_type_accepts_container_size_id_idx on vehicle_type_accepts vta_1 (cost=0.14..0.31 rows=4 width=4) (never executed)

  • Index Cond: (container_size_id = containers_1.container_size_id)
  • Filter: (vehicle_type_id = 2)