explain.depesz.com

PostgreSQL's explain analyze made readable

Result: O4sF

Settings
# exclusive inclusive rows x rows loops node
1. 2.115 1,546.050 ↑ 1.0 1 1

Aggregate (cost=93,212.98..93,212.99 rows=1 width=32) (actual time=1,546.050..1,546.050 rows=1 loops=1)

2. 164.899 1,543.935 ↓ 3,599.0 3,599 1

Nested Loop (cost=673.48..93,212.97 rows=1 width=10) (actual time=35.103..1,543.935 rows=3,599 loops=1)

  • Join Filter: (lic.product_customization_id = pc.id)
  • Rows Removed by Join Filter: 2508559
3. 17.402 1,231.262 ↓ 410.5 73,887 1

Nested Loop (cost=673.48..92,422.71 rows=180 width=14) (actual time=9.479..1,231.262 rows=73,887 loops=1)

4. 21.386 520.583 ↓ 463.7 53,329 1

Nested Loop (cost=673.04..91,667.56 rows=115 width=14) (actual time=9.464..520.583 rows=53,329 loops=1)

5. 99.799 107.075 ↓ 190.6 23,066 1

Bitmap Heap Scan on spree_orders o (cost=672.61..90,359.78 rows=121 width=4) (actual time=9.449..107.075 rows=23,066 loops=1)

  • Recheck Cond: ((completed_at >= '2019-12-31 21:00:00'::timestamp without time zone) AND (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: 16539
  • Heap Blocks: exact=14996
6. 7.276 7.276 ↓ 1.3 40,703 1

Bitmap Index Scan on index_spree_orders_on_completed_at (cost=0.00..672.57 rows=32,014 width=0) (actual time=7.276..7.276 rows=40,703 loops=1)

  • Index Cond: ((completed_at >= '2019-12-31 21:00:00'::timestamp without time zone) AND (completed_at < '2020-04-01 04:00:00'::timestamp without time zone))
7. 392.122 392.122 ↑ 3.0 2 23,066

Index Scan using index_spree_line_items_on_order_id on spree_line_items li (cost=0.43..10.75 rows=6 width=18) (actual time=0.011..0.017 rows=2 loops=23,066)

  • Index Cond: (order_id = o.id)
8. 693.277 693.277 ↑ 6.0 1 53,329

Index Scan using index_spree_line_item_customizations_on_line_item_id on spree_line_item_customizations lic (cost=0.43..6.51 rows=6 width=8) (actual time=0.013..0.013 rows=1 loops=53,329)

  • Index Cond: (line_item_id = li.id)
9. 123.260 147.774 ↓ 1.1 34 73,887

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

10. 24.514 24.514 ↓ 1.1 34 1

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

  • Filter: ((customization_type)::text = 'engine'::text)
  • Rows Removed by Filter: 9424
Planning time : 10.300 ms
Execution time : 1,546.133 ms