explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9M4y

Settings
# exclusive inclusive rows x rows loops node
1. 6.856 104,052.423 ↑ 1.0 1 1

Aggregate (cost=5,633,893.45..5,633,893.46 rows=1 width=32) (actual time=104,052.423..104,052.423 rows=1 loops=1)

2. 0.895 104,045.567 ↑ 21.0 1 1

GroupAggregate (cost=5,633,892.61..5,633,893.18 rows=21 width=36) (actual time=104,045.567..104,045.567 rows=1 loops=1)

  • Group Key: pps.project_id
3. 0.077 104,044.672 ↑ 21.0 1 1

Sort (cost=5,633,892.61..5,633,892.66 rows=21 width=68) (actual time=104,044.671..104,044.672 rows=1 loops=1)

  • Sort Key: pps.project_id
  • Sort Method: quicksort Memory: 43kB
4. 0.085 104,044.595 ↑ 21.0 1 1

Merge Join (cost=5,633,741.58..5,633,892.14 rows=21 width=68) (actual time=104,044.591..104,044.595 rows=1 loops=1)

  • Merge Cond: (pps.id_run = prt.id_run)
5. 0.238 104,034.069 ↑ 4,290.0 1 1

GroupAggregate (cost=5,633,179.02..5,633,275.62 rows=4,290 width=44) (actual time=104,034.068..104,034.069 rows=1 loops=1)

  • Group Key: pps.id_run, pps.project_id
6. 0.000 104,033.831 ↑ 52.4 82 1

Sort (cost=5,633,179.02..5,633,189.76 rows=4,297 width=44) (actual time=104,033.822..104,033.831 rows=82 loops=1)

  • Sort Key: pps.id_run, pps.project_id
  • Sort Method: quicksort Memory: 46kB
7. 69.901 104,076.089 ↑ 52.4 82 1

Gather (cost=1,000.00..5,632,919.72 rows=4,297 width=44) (actual time=104,033.253..104,076.089 rows=82 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 104,006.188 104,006.188 ↑ 66.3 27 3 / 3

Parallel Seq Scan on pricemon_product_shop pps (cost=0.00..5,631,490.02 rows=1,790 width=44) (actual time=69,227.926..104,006.188 rows=27 loops=3)

  • Filter: ((id_run = ANY ('{125785}'::integer[])) AND (sub_status = ANY ('{"Prepare hash to project_id","Send this brand to Toloka"}'::sub_status[])))
  • Rows Removed by Filter: 48741633
9. 0.024 10.441 ↑ 1.0 1 1

Materialize (cost=562.56..562.59 rows=1 width=40) (actual time=10.439..10.441 rows=1 loops=1)

10. 1.037 10.417 ↑ 1.0 1 1

Group (cost=562.56..562.58 rows=1 width=77) (actual time=10.415..10.417 rows=1 loops=1)

  • Group Key: prt.id_run, prt.pool_name, prt.priority
11. 0.363 9.380 ↑ 1.0 1 1

Sort (cost=562.56..562.57 rows=1 width=45) (actual time=9.379..9.380 rows=1 loops=1)

  • Sort Key: prt.id_run, prt.pool_name, prt.priority
  • Sort Method: quicksort Memory: 25kB
12. 0.042 9.017 ↑ 1.0 1 1

Nested Loop (cost=0.29..562.55 rows=1 width=45) (actual time=8.540..9.017 rows=1 loops=1)

13. 8.114 8.114 ↑ 1.0 1 1

Seq Scan on pricemon_run_tasks prt (cost=0.00..554.24 rows=1 width=53) (actual time=7.685..8.114 rows=1 loops=1)

  • Filter: (id_run = ANY ('{125785}'::integer[]))
  • Rows Removed by Filter: 14576
14. 0.861 0.861 ↑ 1.0 1 1

Index Only Scan using pricemon_run_tasks_history_id_task_status_index on pricemon_run_tasks_history prth (cost=0.29..8.31 rows=1 width=8) (actual time=0.814..0.861 rows=1 loops=1)

  • Index Cond: ((id_task = prt.id) AND (status = 'done'::pricemon_run_tasks_history_status))
  • Heap Fetches: 1