explain.depesz.com

PostgreSQL's explain analyze made readable

Result: d7Bv

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 278,676.231 ↑ 572.7 22 1

Finalize GroupAggregate (cost=23,520,860.22..23,531,348.64 rows=12,600 width=75) (actual time=278,647.951..278,676.231 rows=22 loops=1)

  • Group Key: "*SELECT* 1".month, scw.name
2. 74.677 278,683.455 ↑ 630.0 120 1

Gather Merge (cost=23,520,860.22..23,530,655.64 rows=75,600 width=75) (actual time=278,647.816..278,683.455 rows=120 loops=1)

  • Workers Planned: 6
  • Workers Launched: 6
3. 11.964 278,608.778 ↑ 741.2 17 7 / 7

Partial GroupAggregate (cost=23,519,860.12..23,520,467.36 rows=12,600 width=75) (actual time=278,592.942..278,608.778 rows=17 loops=7)

  • Group Key: "*SELECT* 1".month, scw.name
4. 66.029 278,596.814 ↑ 1.0 46,400 7 / 7

Sort (cost=23,519,860.12..23,519,980.43 rows=48,124 width=75) (actual time=278,590.625..278,596.814 rows=46,400 loops=7)

  • Sort Key: "*SELECT* 1".month DESC, scw.name
  • Sort Method: quicksort Memory: 6,065kB
  • Worker 0: Sort Method: quicksort Memory: 9,445kB
  • Worker 1: Sort Method: quicksort Memory: 6,642kB
  • Worker 2: Sort Method: quicksort Memory: 6,354kB
  • Worker 3: Sort Method: quicksort Memory: 9,288kB
  • Worker 4: Sort Method: quicksort Memory: 6,694kB
  • Worker 5: Sort Method: quicksort Memory: 8,876kB
5. 26.859 278,530.785 ↑ 1.0 46,400 7 / 7

Hash Left Join (cost=2.99..23,516,117.40 rows=48,124 width=75) (actual time=42,813.418..278,530.785 rows=46,400 loops=7)

  • Hash Cond: ("*SELECT* 1".sc_workstation_id = scw.id)
6. 6.729 278,502.124 ↑ 6.2 46,400 7 / 7

Parallel Append (cost=0.57..23,515,343.44 rows=287,824 width=48) (actual time=42,811.455..278,502.124 rows=46,400 loops=7)

7. 2.001 497.894 ↓ 4.6 25,594 3 / 7

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

8. 53.249 495.893 ↓ 23.2 25,594 3 / 7

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

9. 285.871 285.871 ↓ 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=6.071..667.033 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.313 277,997.501 ↑ 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=74,412.619..277,997.501 rows=35,432 loops=7)

12. 52.421 277,989.188 ↑ 1.3 35,432 7 / 7

Nested Loop (cost=0.57..23,159,881.89 rows=47,205 width=48) (actual time=74,412.616..277,989.188 rows=35,432 loops=7)

13. 257,937.077 257,937.077 ↑ 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=74,297.466..257,937.077 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. 19,999.690 19,999.690 ↓ 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.052..0.052 rows=0 loops=2,692,266)

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

Hash (cost=1.63..1.63 rows=63 width=43) (actual time=1.801..1.802 rows=63 loops=7)

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

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

Planning time : 500.348 ms
Execution time : 278,683.772 ms