explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B1e8

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 311,239.544 ↓ 0.0 0 1

Limit (cost=4,879.84..21,613.75 rows=100 width=16) (actual time=311,239.544..311,239.544 rows=0 loops=1)

  • Planning time: 4.828 ms
  • Execution time: 311274.283 ms
2. 0.000 311,239.543 ↓ 0.0 0 1

Nested Loop (cost=4,879.84..8,926,896.75 rows=53,317 width=16) (actual time=311,239.543..311,239.543 rows=0 loops=1)

3. 7,657.225 7,657.225 ↑ 1.2 12,717,116 1

Index Scan using idx_orders_status_confirmed_at on orders o (cost=0.56..6,202,122.82 rows=14,988,631 width=16) (actual time=0.005..7,657.225 rows=12,717,116 loops=1)

4. 12,912.797 305,210.784 ↓ 0.0 0 12,717,116

Hash Join (cost=4,879.28..4,879.44 rows=2 width=58) (actual time=0.024..0.024 rows=0 loops=12,717,116)

  • Hash Cond: (oad.order_id = oat.order_id)
  • Join Filter: ((o.status_confirmed_at <= (now() - '3 days'::interval)) OR (oat.value = 'true'::jsonb) OR (oad.value = 'false'::jsonb))
  • Rows Removed by Join Filter: 0
5. 3,982.399 3,982.399 ↓ 0.0 0 3,982,399

Index Scan using order_attributes_order_id on order_attributes oad (cost=0.43..0.56 rows=2 width=25) (actual time=0.001..0.001 rows=0 loops=3,982,399)

  • Index Cond: (order_id = o.id)
  • Filter: (name = 'is_double_check_required'::text)
  • Rows Removed by Filter: 0
6. 0.000 288,315.588 ↓ 0.0 0 8,736,836

Hash (cost=4,878.83..4,878.83 rows=1 width=33) (actual time=0.033..0.033 rows=0 loops=8,736,836)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
7. 167,931.939 288,315.588 ↓ 0.0 0 8,736,836

Merge Join (cost=4,869.05..4,878.83 rows=1 width=33) (actual time=0.033..0.033 rows=0 loops=8,736,836)

  • Merge Cond: (oat.order_id = oa.order_id)
8. 8,736.836 8,736.836 ↓ 0.0 0 8,736,836

Index Scan using order_attributes_order_id on order_attributes oat (cost=0.43..0.56 rows=2 width=25) (actual time=0.001..0.001 rows=0 loops=8,736,836)

  • Index Cond: (order_id = o.id)
  • Filter: (name = 'is_terminal'::text)
  • Rows Removed by Filter: 1
9. 111,645.711 111,646.813 ↑ 1.4 1,384 2,723,093

Sort (cost=4,868.62..4,873.44 rows=1,927 width=8) (actual time=0.000..0.041 rows=1,384 loops=2,723,093)

  • Sort Key: oa.order_id
  • Sort Method: quicksort Memory: 196kB
10. 1.102 1.102 ↓ 1.1 2,118 1

Index Scan using order_attributes_is_under_double_check on order_attributes oa (cost=0.28..4,763.48 rows=1,927 width=8) (actual time=0.008..1.102 rows=2,118 loops=1)

  • Index Cond: (name = 'is_under_double_check'::text)