explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CIyW : Optimization for: base plan for \d from psql; plan #KrT2

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 1.138 6,955.858 ↓ 0.0 0 1

Nested Loop (cost=1.44..388,187.80 rows=1 width=1,722) (actual time=6,955.858..6,955.858 rows=0 loops=1)

2. 3,037.024 6,940.381 ↓ 1,103.0 1,103 1

Nested Loop Left Join (cost=0.87..388,187.08 rows=1 width=1,592) (actual time=512.341..6,940.381 rows=1,103 loops=1)

  • Join Filter: (transactio2_.id = transactio2_2_.transaction_id)
  • Rows Removed by Join Filter: 30,692,078
3. 2.209 1,582.645 ↓ 1,103.0 1,103 1

Nested Loop Left Join (cost=0.87..387,322.04 rows=1 width=1,558) (actual time=500.467..1,582.645 rows=1,103 loops=1)

  • Join Filter: (transactio2_.id = transactio2_1_.transaction_id)
4. 1.374 1,580.436 ↓ 1,103.0 1,103 1

Nested Loop (cost=0.87..387,305.29 rows=1 width=1,324) (actual time=500.455..1,580.436 rows=1,103 loops=1)

  • Join Filter: (this_.id = transactio2_.shopping_basket_id)
5. 0.767 1,575.202 ↓ 386.0 386 1

Nested Loop (cost=0.43..387,295.42 rows=1 width=991) (actual time=500.431..1,575.202 rows=386 loops=1)

6. 1,571.347 1,571.347 ↑ 1.3 386 1

Seq Scan on shopping_basket this_ (cost=0.00..383,171.28 rows=488 width=156) (actual time=500.377..1,571.347 rows=386 loops=1)

  • Filter: (booking_valid_until IS NOT NULL)
  • Rows Removed by Filter: 14,635,046
7. 3.088 3.088 ↑ 1.0 1 386

Index Scan using "shopping_basket_payment$shopping_basket_id$idx" on shopping_basket_payment apayment1_ (cost=0.43..8.44 rows=1 width=835) (actual time=0.008..0.008 rows=1 loops=386)

  • Index Cond: (shopping_basket_id = this_.id)
  • Filter: (booking_valid_until < '2017-05-22 13:32:00'::timestamp without time zone)
8. 3.860 3.860 ↑ 1.0 3 386

Index Scan using "transaction$shopping_basket_id$idx" on transaction transactio2_ (cost=0.44..9.84 rows=3 width=333) (actual time=0.006..0.010 rows=3 loops=386)

  • Index Cond: (shopping_basket_id = apayment1_.shopping_basket_id)
9. 0.000 0.000 ↓ 0.0 0 1,103

Seq Scan on transaction_open_ticket_details transactio2_1_ (cost=0.00..13.00 rows=300 width=238) (actual time=0.000..0.000 rows=0 loops=1,103)

10. 2,320.712 2,320.712 ↓ 1.0 27,826 1,103

Seq Scan on transaction_transfer_details transactio2_2_ (cost=0.00..517.24 rows=27,824 width=38) (actual time=0.001..2.104 rows=27,826 loops=1,103)

11. 14.339 14.339 ↓ 0.0 0 1,103

Index Scan using "transaction_status$pk" on transaction_status transactio3_ (cost=0.56..0.71 rows=1 width=130) (actual time=0.013..0.013 rows=0 loops=1,103)

  • Index Cond: (id = transactio2_.current_status_id)
  • Filter: ((status_xc)::text = 'TRANSACTION_STATUS.SOLD'::text)
  • Rows Removed by Filter: 1
Planning time : 6.041 ms
Execution time : 6,956.446 ms