explain.depesz.com

PostgreSQL's explain analyze made readable

Result: s3tF

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Unique (cost=9,574,393.80..9,574,393.92 rows=24 width=8) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=9,574,393.80..9,574,393.86 rows=24 width=8) (actual rows= loops=)

  • Sort Key: products1_.id
3. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=39,701.67..9,574,393.25 rows=24 width=8) (actual rows= loops=)

  • Join Filter: (basket0_.id = flightbask7_1_.basket_products_id)
4. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=2,305.32..8,875,693.47 rows=47 width=24) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=2,004.12..5,289,314.68 rows=94 width=24) (actual rows= loops=)

  • Join Filter: (basket0_.id = generics5_.basket_products_id)
6. 0.000 0.000 ↓ 0.0

Gather (cost=2,004.12..719,617.43 rows=189 width=24) (actual rows= loops=)

  • Workers Planned: 2
7. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,004.12..718,598.53 rows=79 width=24) (actual rows= loops=)

  • Hash Cond: (documentst3_.status_type_id = lookupvalu4_.id)
  • Filter: ((documentst3_.id IS NULL) OR (((documentst3_.code)::text = 'Tickets/Voucher'::text) AND (documentst3_.senttoclient IS NULL)) OR (((documentst3_.id IS NULL) OR ((documentst3_.code)::text = 'Tickets/Voucher'::te (...)
8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.29..717,585.78 rows=493 width=59) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.86..713,740.18 rows=493 width=32) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..711,610.95 rows=270 width=24) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on basketproduct products1_ (cost=0.00..654,141.96 rows=7,115 width=16) (actual rows= loops=)

  • Filter: (status = 12)
12. 0.000 0.000 ↓ 0.0

Index Scan using basket_pkey on basket basket0_ (cost=0.43..8.08 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = products1_.basket_products_id)
  • Filter: ((creationdate < '2018-07-01 00:00:00'::timestamp without time zone) AND (status = 2) AND (ticketingtype = 7))
13. 0.000 0.000 ↓ 0.0

Index Scan using documentsstatus_basket_product_basket_product_idx on documentsstatus_basket_product documentss2_ (cost=0.43..7.87 rows=2 width=16) (actual rows= loops=)

  • Index Cond: (products1_.id = basket_product_id)
14. 0.000 0.000 ↓ 0.0

Index Scan using documentstatus_pkey on documentstatus documentst3_ (cost=0.43..7.80 rows=1 width=35) (actual rows= loops=)

  • Index Cond: (documentss2_.doc_status_id = id)
15. 0.000 0.000 ↓ 0.0

Hash (cost=674.59..674.59 rows=26,259 width=22) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on lookupvalue lookupvalu4_ (cost=0.00..674.59 rows=26,259 width=22) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..4,521,329.48 rows=17,076 width=8) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on basketproduct generics5_ (cost=0.00..4,521,244.10 rows=17,076 width=8) (actual rows= loops=)

  • Filter: ((SubPlan 1) = 'Generic'::text)
19.          

SubPlan (forSeq Scan)

20. 0.000 0.000 ↓ 0.0

Seq Scan on product __product (cost=0.00..1.12 rows=1 width=32) (actual rows= loops=)

  • Filter: (id = generics5_.product_id)
21. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on basketproduct addontours6_ (cost=301.20..75,123.62 rows=85 width=8) (actual rows= loops=)

  • Recheck Cond: (basket0_.id = basket_products_id)
  • Filter: ((SubPlan 2) = 'Addon Tour'::text)
22. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on basketproduct_basket_products_idx (cost=0.00..301.18 rows=17,076 width=0) (actual rows= loops=)

  • Index Cond: (basket0_.id = basket_products_id)
23.          

SubPlan (forBitmap Heap Scan)

24. 0.000 0.000 ↓ 0.0

Seq Scan on product __product_1 (cost=0.00..1.12 rows=1 width=32) (actual rows= loops=)

  • Filter: (id = addontours6_.product_id)
25. 0.000 0.000 ↓ 0.0

Materialize (cost=37,396.34..695,603.86 rows=4,407 width=8) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Gather (cost=37,396.34..695,581.83 rows=4,407 width=8) (actual rows= loops=)

  • Workers Planned: 2
27. 0.000 0.000 ↓ 0.0

Hash Join (cost=36,396.34..694,141.13 rows=1,836 width=8) (actual rows= loops=)

  • Hash Cond: (flightbask7_1_.id = flightbask7_.id)
28. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on basketproduct flightbask7_1_ (cost=0.00..654,141.96 rows=7,115 width=16) (actual rows= loops=)

  • Filter: (status = 12)
29. 0.000 0.000 ↓ 0.0

Hash (cost=21,935.93..21,935.93 rows=881,393 width=8) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Seq Scan on flightbasketproduct flightbask7_ (cost=0.00..21,935.93 rows=881,393 width=8) (actual rows= loops=)