explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lhAJ

Settings
# exclusive inclusive rows x rows loops node
1. 6.294 115,126.335 ↑ 1.0 1 1

Aggregate (cost=327,792.86..327,792.87 rows=1 width=32) (actual time=115,126.335..115,126.335 rows=1 loops=1)

2. 322.232 115,120.041 ↓ 3,582.0 3,582 1

Nested Loop (cost=18,270.00..327,792.85 rows=1 width=10) (actual time=18,683.892..115,120.041 rows=3,582 loops=1)

  • Join Filter: (lic.product_customization_id = pc.id)
  • Rows Removed by Join Filter: 2459548
3. 49.131 114,652.919 ↓ 243.1 72,445 1

Nested Loop (cost=18,270.00..326,947.72 rows=298 width=14) (actual time=9,807.022..114,652.919 rows=72,445 loops=1)

4. 367.777 98,179.704 ↓ 275.3 52,306 1

Nested Loop (cost=18,269.57..325,673.69 rows=190 width=14) (actual time=9,806.994..98,179.704 rows=52,306 loops=1)

5. 37,858.187 37,984.054 ↓ 149.3 559,139 1

Bitmap Heap Scan on spree_orders o (cost=18,269.13..287,137.49 rows=3,745 width=4) (actual time=168.829..37,984.054 rows=559,139 loops=1)

  • Recheck Cond: (completed_at < '2020-04-01 04:00:00'::timestamp without time zone)
  • Filter: ((store_id = 1) AND ((state)::text = 'complete'::text) AND ((payment_state)::text = 'paid'::text))
  • Rows Removed by Filter: 450110
  • Heap Blocks: exact=177973
6. 125.867 125.867 ↓ 1.0 1,010,675 1

Bitmap Index Scan on index_spree_orders_on_completed_at (cost=0.00..18,268.19 rows=988,768 width=0) (actual time=125.867..125.867 rows=1,010,675 loops=1)

  • Index Cond: (completed_at < '2020-04-01 04:00:00'::timestamp without time zone)
7. 59,827.873 59,827.873 ↓ 0.0 0 559,139

Index Scan using index_spree_line_items_on_order_id on spree_line_items li (cost=0.43..10.28 rows=1 width=18) (actual time=0.105..0.107 rows=0 loops=559,139)

  • Index Cond: (order_id = o.id)
  • Filter: (created_at >= '2019-12-31 21:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 2
8. 16,424.084 16,424.084 ↑ 6.0 1 52,306

Index Scan using index_spree_line_item_customizations_on_line_item_id on spree_line_item_customizations lic (cost=0.43..6.65 rows=6 width=8) (actual time=0.311..0.314 rows=1 loops=52,306)

  • Index Cond: (line_item_id = li.id)
9. 139.274 144.890 ↓ 1.1 34 72,445

Materialize (cost=0.00..706.64 rows=31 width=4) (actual time=0.000..0.002 rows=34 loops=72,445)

10. 5.616 5.616 ↓ 1.1 34 1

Seq Scan on spree_product_customizations pc (cost=0.00..706.49 rows=31 width=4) (actual time=0.094..5.616 rows=34 loops=1)

  • Filter: ((customization_type)::text = 'engine'::text)
  • Rows Removed by Filter: 9424
Planning time : 0.712 ms
Execution time : 115,134.916 ms