explain.depesz.com

PostgreSQL's explain analyze made readable

Result: q1EG

Settings
# exclusive inclusive rows x rows loops node
1. 4,256.810 4,464.742 ↓ 0.0 0 1

Update on orders_orderitem (cost=2,758.11..5,227.68 rows=1,000 width=3,450) (actual time=4,464.742..4,464.742 rows=0 loops=1)

2. 3.024 207.932 ↑ 1.0 1,000 1

Nested Loop (cost=2,758.11..5,227.68 rows=1,000 width=3,450) (actual time=184.899..207.932 rows=1,000 loops=1)

3. 1.545 185.908 ↑ 1.0 1,000 1

HashAggregate (cost=2,757.68..2,767.68 rows=1,000 width=32) (actual time=184.879..185.908 rows=1,000 loops=1)

  • Group Key: "ANY_subquery".col1
4. 0.496 184.363 ↑ 1.0 1,000 1

Subquery Scan on ANY_subquery (cost=0.99..2,755.18 rows=1,000 width=32) (actual time=41.284..184.363 rows=1,000 loops=1)

5. 0.187 183.867 ↑ 1.0 1,000 1

Limit (cost=0.99..2,745.18 rows=1,000 width=4) (actual time=41.278..183.867 rows=1,000 loops=1)

6. 0.283 183.680 ↑ 495.9 1,000 1

Nested Loop (cost=0.99..1,360,760.98 rows=495,871 width=4) (actual time=41.277..183.680 rows=1,000 loops=1)

7. 15.205 15.205 ↑ 69.7 7,008 1

Index Only Scan using idx_order_from_partner_slug_order_id on orders_order (cost=0.56..335,421.02 rows=488,344 width=4) (actual time=0.017..15.205 rows=7,008 loops=1)

  • Index Cond: (from_partner_slug = 'trivago.affiliate.039e3ffd'::text)
  • Heap Fetches: 6983
8. 168.192 168.192 ↓ 0.0 0 7,008

Index Scan using orders_orderitem_69dfcb07 on orders_orderitem orders_orderitem_1 (cost=0.44..2.09 rows=1 width=4) (actual time=0.024..0.024 rows=0 loops=7,008)

  • Index Cond: (order_id = orders_order.order_id)
  • Filter: (contract_id IS NULL)
  • Rows Removed by Filter: 1
9. 19.000 19.000 ↑ 1.0 1 1,000

Index Scan using idx_orderitem_order_id_sorted on orders_orderitem (cost=0.44..2.45 rows=1 width=3,394) (actual time=0.013..0.019 rows=1 loops=1,000)

  • Index Cond: (order_id = "ANY_subquery".col1)
Planning time : 1.168 ms
Execution time : 4,464.995 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
t_orders_orderitem_b1000iu_row_version_id 783.113 ms 1000 0.783 ms