explain.depesz.com

PostgreSQL's explain analyze made readable

Result: idBB : national results wo ordering

Settings
# exclusive inclusive rows x rows loops node
1. 9,394.321 177,350.240 ↑ 1,860.3 730 1

GroupAggregate (cost=356,690.13..390,752.87 rows=1,358,049 width=40) (actual time=159,003.516..177,350.240 rows=730 loops=1)

  • Group Key: next_assorted_query.product_upc
2. 18,149.865 167,955.919 ↑ 1.0 1,359,365 1

Sort (cost=356,690.13..360,103.84 rows=1,365,483 width=10) (actual time=159,002.177..167,955.919 rows=1,359,365 loops=1)

  • Sort Key: next_assorted_query.product_upc
  • Sort Method: external merge Disk: 26640kB
3. 25,735.756 149,806.054 ↑ 1.0 1,359,365 1

Subquery Scan on next_assorted_query (cost=39.78..194,202.73 rows=1,365,483 width=10) (actual time=69,441.434..149,806.054 rows=1,359,365 loops=1)

  • Filter: (next_assorted_query.optimisation_id = 30)
  • Rows Removed by Filter: 1365915
4. 36,830.061 124,070.298 ↓ 1.0 2,725,280 1

WindowAgg (cost=39.78..160,145.13 rows=2,724,608 width=14) (actual time=12.174..124,070.298 rows=2,725,280 loops=1)

5. 33,514.615 87,240.237 ↓ 1.0 2,725,280 1

Nested Loop (cost=39.78..126,087.53 rows=2,724,608 width=13) (actual time=12.115..87,240.237 rows=2,725,280 loops=1)

6. 0.061 0.061 ↑ 1.0 1 1

Index Only Scan using customer_groups_pkey on customer_groups (cost=0.15..8.17 rows=1 width=0) (actual time=0.047..0.061 rows=1 loops=1)

  • Index Cond: (id = 1)
  • Heap Fetches: 1
7. 34,964.154 53,725.561 ↓ 1.0 2,725,280 1

Hash Join (cost=39.63..98,833.28 rows=2,724,608 width=13) (actual time=12.046..53,725.561 rows=2,725,280 loops=1)

  • Hash Cond: (assortment_products.product_id = products.id)
8. 18,749.562 18,749.562 ↓ 1.0 2,725,280 1

Seq Scan on assortment_products (cost=0.00..91,608.50 rows=2,724,608 width=9) (actual time=0.152..18,749.562 rows=2,725,280 loops=1)

  • Filter: (optimisation_id = ANY ('{30,29}'::integer[]))
  • Rows Removed by Filter: 560
9. 5.960 11.845 ↑ 1.0 917 1

Hash (cost=28.17..28.17 rows=917 width=12) (actual time=11.839..11.845 rows=917 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 48kB
10. 5.885 5.885 ↑ 1.0 917 1

Seq Scan on products (cost=0.00..28.17 rows=917 width=12) (actual time=0.012..5.885 rows=917 loops=1)

Planning time : 2.163 ms
Execution time : 177,360.848 ms