explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UUT7 : Optimization for: plan #s3tF

Settings

Optimization path:

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

Unique (cost=4,785,932.71..4,785,966.84 rows=6,825 width=8) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=4,785,932.71..4,785,949.78 rows=6,825 width=8) (actual rows= loops=)

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

Hash Semi Join (cost=2,625,797.04..4,785,498.08 rows=6,825 width=8) (actual rows= loops=)

  • Hash Cond: (basket0_.id = flightbask7_1_.basket_products_id)
4. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=1,585,558.85..3,740,996.20 rows=30,196 width=24) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=1,585,558.42..2,815,580.69 rows=30,408 width=24) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,585,557.99..1,883,652.46 rows=30,622 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'::text)) A (...)
7. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=1,584,541.43..1,878,765.26 rows=192,332 width=59) (actual rows= loops=)

  • Hash Cond: (documentst3_.id = documentss2_.doc_status_id)
8. 0.000 0.000 ↓ 0.0

Seq Scan on documentstatus documentst3_ (cost=0.00..170,085.63 rows=6,240,563 width=35) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash (cost=1,580,822.28..1,580,822.28 rows=192,332 width=32) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=1,396,476.27..1,580,822.28 rows=192,332 width=32) (actual rows= loops=)

  • Hash Cond: (documentss2_.basket_product_id = products1_.id)
11. 0.000 0.000 ↓ 0.0

Seq Scan on documentsstatus_basket_product documentss2_ (cost=0.00..96,791.86 rows=6,280,486 width=16) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash (cost=1,394,143.16..1,394,143.16 rows=127,049 width=24) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Gather (cost=481,962.97..1,394,143.16 rows=127,049 width=24) (actual rows= loops=)

  • Workers Planned: 2
14. 0.000 0.000 ↓ 0.0

Hash Join (cost=480,962.97..1,380,438.26 rows=52,937 width=24) (actual rows= loops=)

  • Hash Cond: (products1_.basket_products_id = basket0_.id)
15. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on basketproduct products1_ (cost=0.00..881,682.91 rows=1,409,297 width=16) (actual rows= loops=)

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

Hash (cost=479,568.86..479,568.86 rows=111,529 width=8) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on basket basket0_ (cost=0.00..479,568.86 rows=111,529 width=8) (actual rows= loops=)

  • Filter: ((creationdate < '2018-07-01 00:00:00'::timestamp without time zone) AND (status = 2) AND (ticketingtype = 7))
18. 0.000 0.000 ↓ 0.0

Hash (cost=684.03..684.03 rows=26,603 width=22) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

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

20. 0.000 0.000 ↓ 0.0

Index Scan using basketproduct_basket_products_idx on basketproduct generics5_ (cost=0.43..30.43 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (basket0_.id = basket_products_id)
  • Filter: ((SubPlan 1) = 'Generic'::text)
21.          

SubPlan (forIndex Scan)

22. 0.000 0.000 ↓ 0.0

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

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

Index Scan using basketproduct_basket_products_idx on basketproduct addontours6_ (cost=0.43..30.43 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (basket0_.id = basket_products_id)
  • Filter: ((SubPlan 2) = 'Addon Tour'::text)
24.          

SubPlan (forIndex Scan)

25. 0.000 0.000 ↓ 0.0

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

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

Hash (cost=1,028,484.16..1,028,484.16 rows=716,402 width=8) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Hash Join (cost=37,383.49..1,028,484.16 rows=716,402 width=8) (actual rows= loops=)

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

Seq Scan on basketproduct flightbask7_1_ (cost=0.00..911,933.99 rows=3,382,312 width=16) (actual rows= loops=)

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

Hash (cost=22,966.33..22,966.33 rows=878,733 width=8) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Seq Scan on flightbasketproduct flightbask7_ (cost=0.00..22,966.33 rows=878,733 width=8) (actual rows= loops=)