explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Q7Ky

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 90.935 ↓ 0.0 0 1

GroupAggregate (cost=3,436,416.40..3,436,455.39 rows=200 width=40) (actual time=90.935..90.935 rows=0 loops=1)

  • Group Key: (to_char((co.operation_date - ('1 day'::interval * ($1)::double precision)), 'YYYY-MM'::text))
2.          

CTE params

3. 0.093 0.093 ↑ 1.0 1 1

Index Scan using app_property_pkey on app_property ap (cost=0.14..2.19 rows=1 width=20) (actual time=0.091..0.093 rows=1 loops=1)

  • Index Cond: ((property_name)::text = 'cell_content_auto_move_to_wanted'::text)
4. 0.034 90.931 ↓ 0.0 0 1

Sort (cost=3,436,414.21..3,436,426.54 rows=4,932 width=40) (actual time=90.931..90.931 rows=0 loops=1)

  • Sort Key: (to_char((co.operation_date - ('1 day'::interval * ($1)::double precision)), 'YYYY-MM'::text)) DESC
  • Sort Method: quicksort Memory: 25kB
5. 0.000 90.897 ↓ 0.0 0 1

Append (cost=1,000.63..3,436,111.68 rows=4,932 width=40) (actual time=90.897..90.897 rows=0 loops=1)

6. 54.969 55.094 ↓ 0.0 0 1

Gather (cost=1,000.63..64,506.93 rows=1,690 width=40) (actual time=54.979..55.094 rows=0 loops=1)

  • Workers Planned: 3
  • Params Evaluated: $1, $2, $3
  • Workers Launched: 3
7.          

Initplan (for Gather)

8. 0.098 0.098 ↑ 1.0 1 1

CTE Scan on params (cost=0.00..0.02 rows=1 width=4) (actual time=0.096..0.098 rows=1 loops=1)

9. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on params params_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.001 rows=1 loops=1)

10. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on params params_2 (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.000 rows=1 loops=1)

11. 0.026 0.026 ↓ 0.0 0 4 / 4

Parallel Index Scan using idx_container_operation_operation_date on container_operation co (cost=0.57..63,337.87 rows=545 width=40) (actual time=0.025..0.026 rows=0 loops=4)

  • Index Cond: ((operation_date >= $2) AND (operation_date <= $3))
  • Filter: ((sc_user_id = '-1'::integer) AND (operation_type_code = 60))
12. 39.582 39.615 ↓ 0.0 0 1

Gather (cost=1,000.63..3,371,530.78 rows=3,242 width=40) (actual time=35.912..39.615 rows=0 loops=1)

  • Workers Planned: 5
  • Params Evaluated: $4, $5, $6
  • Workers Launched: 5
13.          

Initplan (for Gather)

14. 0.006 0.006 ↑ 1.0 1 1

CTE Scan on params params_3 (cost=0.00..0.02 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1)

15. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on params params_4 (cost=0.00..0.02 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1)

16. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on params params_5 (cost=0.00..0.02 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1)

17. 0.024 0.024 ↓ 0.0 0 6 / 6

Parallel Index Scan using idx_rpi_operation_operation_date on rpi_operation ro (cost=0.57..3,370,206.52 rows=648 width=40) (actual time=0.024..0.024 rows=0 loops=6)

  • Index Cond: ((operation_date >= $5) AND (operation_date <= $6))
  • Filter: ((sc_user_id = '-1'::integer) AND (operation_type_code = 60))
Planning time : 1,511.826 ms
Execution time : 95.017 ms