explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UwSn

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 329,402.343 ↑ 572.7 22 1

Finalize GroupAggregate (cost=23,518,170.14..23,528,328.91 rows=12,600 width=75) (actual time=329,379.740..329,402.343 rows=22 loops=1)

  • Group Key: "*SELECT* 1".month, scw.name
2. 106.489 329,409.102 ↑ 640.7 118 1

Gather Merge (cost=23,518,170.14..23,527,635.91 rows=75,600 width=75) (actual time=329,379.680..329,409.102 rows=118 loops=1)

  • Workers Planned: 6
  • Workers Launched: 6
3. 9.676 329,302.613 ↑ 741.2 17 7 / 7

Partial GroupAggregate (cost=23,517,170.04..23,517,447.63 rows=12,600 width=75) (actual time=329,290.140..329,302.613 rows=17 loops=7)

  • Group Key: "*SELECT* 1".month, scw.name
4. 60.144 329,292.937 ↓ 3.1 46,400 7 / 7

Sort (cost=23,517,170.04..23,517,207.93 rows=15,159 width=75) (actual time=329,288.586..329,292.937 rows=46,400 loops=7)

  • Sort Key: "*SELECT* 1".month DESC, scw.name
  • Sort Method: quicksort Memory: 6,388kB
  • Worker 0: Sort Method: quicksort Memory: 6,300kB
  • Worker 1: Sort Method: quicksort Memory: 9,233kB
  • Worker 2: Sort Method: quicksort Memory: 9,451kB
  • Worker 3: Sort Method: quicksort Memory: 6,330kB
  • Worker 4: Sort Method: quicksort Memory: 6,258kB
  • Worker 5: Sort Method: quicksort Memory: 9,403kB
5. 29.149 329,232.793 ↓ 3.1 46,400 7 / 7

Hash Join (cost=2.99..23,516,117.40 rows=15,159 width=75) (actual time=44,235.299..329,232.793 rows=46,400 loops=7)

  • Hash Cond: ("*SELECT* 1".sc_workstation_id = scw.id)
6. 7.188 329,201.857 ↑ 6.2 46,400 7 / 7

Parallel Append (cost=0.57..23,515,343.44 rows=287,824 width=48) (actual time=44,233.363..329,201.857 rows=46,400 loops=7)

7. 2.105 505.281 ↓ 4.6 25,594 3 / 7

Subquery Scan on *SELECT* 1 (cost=1.00..351,190.11 rows=5,510 width=48) (actual time=10.895..1,178.989 rows=25,594 loops=3)

8. 54.636 503.176 ↓ 23.2 25,594 3 / 7

Nested Loop (cost=1.00..351,135.01 rows=1,102 width=48) (actual time=10.892..1,174.078 rows=25,594 loops=3)

9. 291.768 291.768 ↓ 5.7 121,934 3 / 7

Parallel Index Scan using idx_container_operation_operation_date on container_operation co (cost=0.57..309,221.44 rows=21,555 width=32) (actual time=9.841..680.791 rows=121,934 loops=3)

  • Index Cond: ((operation_date >= '2018-08-23 14:40:00+03'::timestamp with time zone) AND (operation_date <= '2018-09-24 14:40:00+03'::timestamp with time zone))
  • Filter: ((sc_user_id <> '-1'::integer) AND (operation_type_code = 45))
  • Rows Removed by Filter: 816,095
10. 156.772 156.772 ↓ 0.0 0 365,802 / 7

Index Scan using container_assignment_pkey on container_assignment ca (cost=0.44..1.94 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=365,802)

  • Index Cond: (id = co.container_assignment_id)
  • Filter: (cell_id = 1)
  • Rows Removed by Filter: 1
11. 8.596 328,689.388 ↑ 8.0 35,432 7 / 7

Subquery Scan on *SELECT* 2 (cost=0.57..23,162,714.21 rows=283,232 width=48) (actual time=77,057.887..328,689.388 rows=35,432 loops=7)

12. 75.497 328,680.792 ↑ 1.3 35,432 7 / 7

Nested Loop (cost=0.57..23,159,881.89 rows=47,205 width=48) (actual time=77,057.884..328,680.792 rows=35,432 loops=7)

13. 326,297.638 326,297.638 ↑ 1.3 384,609 7 / 7

Parallel Seq Scan on rpi_operation ro (cost=0.00..22,255,127.03 rows=481,001 width=32) (actual time=76,795.188..326,297.638 rows=384,609 loops=7)

  • Filter: ((sc_user_id <> '-1'::integer) AND (operation_date >= '2018-08-23 14:40:00+03'::timestamp with time zone) AND (operation_date <= '2018-09-24 14:40:00+03'::timestamp with time zone) AND (operation_t
  • Rows Removed by Filter: 107,754,554
14. 2,307.657 2,307.657 ↓ 0.0 0 2,692,266 / 7

Index Scan using rpi_assignment_pkey on rpi_assignment ra (cost=0.57..1.88 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=2,692,266)

  • Index Cond: (id = ro.rpi_assignment_id)
  • Filter: (cell_id = 1)
  • Rows Removed by Filter: 1
15. 0.069 1.787 ↑ 1.0 63 7 / 7

Hash (cost=1.63..1.63 rows=63 width=43) (actual time=1.786..1.787 rows=63 loops=7)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
16. 1.718 1.718 ↑ 1.0 63 7 / 7

Seq Scan on sc_workstation scw (cost=0.00..1.63 rows=63 width=43) (actual time=1.702..1.718 rows=63 loops=7)

Planning time : 1,725.490 ms
Execution time : 329,409.543 ms