explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MNLx

Settings
# exclusive inclusive rows x rows loops node
1. 70.792 185.223 ↑ 124.7 6 1

Sort (cost=22,564.26..22,566.13 rows=748 width=104) (actual time=185.079..185.223 rows=6 loops=1)

  • Sort Key: pps.project_id, tasks_data.priority
  • Sort Method: external merge Disk: 23736kB
2. 56.617 114.431 ↑ 124.7 6 1

HashAggregate (cost=22,515.46..22,528.55 rows=748 width=104) (actual time=113.954..114.431 rows=6 loops=1)

  • Group Key: pps.project_id, tasks_data.pool_name, tasks_data.priority
3. 19.902 57.814 ↓ 5.3 106,440 1

Hash Join (cost=74.25..22,264.83 rows=20,051 width=110) (actual time=4.956..57.814 rows=106,440 loops=1)

  • Hash Cond: (pps.id_run = tasks_data.id_run)
4. 37.039 37.039 ↓ 4.4 106,441 1

Index Scan using pricemon_product_shop_project_id_sub_status_index on pricemon_product_shop pps (cost=0.42..21,900.02 rows=24,125 width=86) (actual time=4.067..37.039 rows=106,441 loops=1)

  • Index Cond: ((project_id IS NOT NULL) AND (sub_status = ANY ('{"Prepare hash to project_id","Send this brand to Toloka"}'::sub_status[])))
  • Filter: (project_id <> 0)
  • Rows Removed by Filter: 608
5. 0.039 0.873 ↑ 1.2 154 1

Hash (cost=71.49..71.49 rows=187 width=40) (actual time=0.873..0.873 rows=154 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
6. 0.022 0.834 ↑ 1.2 154 1

Subquery Scan on tasks_data (cost=67.75..71.49 rows=187 width=40) (actual time=0.783..0.834 rows=154 loops=1)

7. 0.198 0.812 ↑ 1.2 154 1

HashAggregate (cost=67.75..69.62 rows=187 width=40) (actual time=0.782..0.812 rows=154 loops=1)

  • Group Key: prt.id_run, prt.pool_name, prt.priority
8. 0.130 0.614 ↓ 1.1 408 1

Hash Join (cost=38.29..64.89 rows=381 width=40) (actual time=0.346..0.614 rows=408 loops=1)

  • Hash Cond: (prth.id_task = prt.id)
9. 0.165 0.165 ↓ 1.0 411 1

Index Only Scan using pricemon_run_tasks_history_id_task_status_index on pricemon_run_tasks_history prth (cost=0.28..25.83 rows=395 width=8) (actual time=0.019..0.165 rows=411 loops=1)

  • Index Cond: (status = 'done'::pricemon_run_tasks_history_status)
  • Heap Fetches: 179
10. 0.142 0.319 ↑ 1.0 445 1

Hash (cost=32.45..32.45 rows=445 width=48) (actual time=0.319..0.319 rows=445 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 46kB
11. 0.177 0.177 ↑ 1.0 445 1

Seq Scan on pricemon_run_tasks prt (cost=0.00..32.45 rows=445 width=48) (actual time=0.010..0.177 rows=445 loops=1)

Planning time : 0.466 ms
Execution time : 191.332 ms