explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2pL3 : Optimization for: plan #jK9W

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 0.911 ↓ 10.0 10 1

Limit (cost=34.48..1,184.04 rows=1 width=370) (actual time=0.202..0.911 rows=10 loops=1)

2.          

Initplan (for Limit)

3. 0.009 0.041 ↑ 1.0 1 1

Aggregate (cost=10.59..10.60 rows=1 width=32) (actual time=0.041..0.041 rows=1 loops=1)

4. 0.003 0.032 ↓ 7.0 7 1

Nested Loop (cost=0.43..10.58 rows=1 width=5) (actual time=0.010..0.032 rows=7 loops=1)

5. 0.008 0.008 ↓ 7.0 7 1

Seq Scan on pcy_fleet_join pfj1 (cost=0.00..2.12 rows=1 width=8) (actual time=0.007..0.008 rows=7 loops=1)

  • Filter: (general_policy_number = general_policy_number)
  • Rows Removed by Filter: 13
6. 0.021 0.021 ↑ 1.0 1 7

Index Scan using pk_pcy_policy on pcy_policy pcy1 (cost=0.43..8.45 rows=1 width=13) (actual time=0.002..0.003 rows=1 loops=7)

  • Index Cond: (id = pfj1.policy_id)
7. 0.008 0.026 ↑ 1.0 1 1

Aggregate (cost=10.59..10.60 rows=1 width=32) (actual time=0.026..0.026 rows=1 loops=1)

8. 0.006 0.018 ↓ 7.0 7 1

Nested Loop (cost=0.43..10.58 rows=1 width=4) (actual time=0.007..0.018 rows=7 loops=1)

9. 0.005 0.005 ↓ 7.0 7 1

Seq Scan on pcy_fleet_join pfj1_1 (cost=0.00..2.12 rows=1 width=8) (actual time=0.005..0.005 rows=7 loops=1)

  • Filter: (general_policy_number = general_policy_number)
  • Rows Removed by Filter: 13
10. 0.007 0.007 ↑ 1.0 1 7

Index Scan using pk_pcy_policy on pcy_policy pcy1_1 (cost=0.43..8.45 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=7)

  • Index Cond: (id = pfj1_1.policy_id)
11. 0.000 0.020 ↑ 1.0 1 1

Aggregate (cost=10.58..10.59 rows=1 width=8) (actual time=0.020..0.020 rows=1 loops=1)

12. 0.001 0.020 ↓ 7.0 7 1

Nested Loop (cost=0.43..10.58 rows=1 width=2) (actual time=0.007..0.020 rows=7 loops=1)

13. 0.005 0.005 ↓ 7.0 7 1

Seq Scan on pcy_fleet_join pfj1_2 (cost=0.00..2.12 rows=1 width=8) (actual time=0.005..0.005 rows=7 loops=1)

  • Filter: (general_policy_number = general_policy_number)
  • Rows Removed by Filter: 13
14. 0.014 0.014 ↑ 1.0 1 7

Index Scan using pk_pcy_policy on pcy_policy pcy1_2 (cost=0.43..8.45 rows=1 width=10) (actual time=0.002..0.002 rows=1 loops=7)

  • Index Cond: (id = pfj1_2.policy_id)
15. 0.144 0.909 ↓ 10.0 10 1

Nested Loop (cost=2.70..1,152.25 rows=1 width=370) (actual time=0.201..0.909 rows=10 loops=1)

16. 0.010 0.333 ↓ 10.0 10 1

Nested Loop (cost=2.42..273.66 rows=1 width=193) (actual time=0.099..0.333 rows=10 loops=1)

17. 0.008 0.273 ↓ 10.0 10 1

Nested Loop (cost=2.00..273.18 rows=1 width=139) (actual time=0.089..0.273 rows=10 loops=1)

18. 0.004 0.215 ↓ 10.0 10 1

Nested Loop (cost=1.71..272.87 rows=1 width=155) (actual time=0.056..0.215 rows=10 loops=1)

19. 0.000 0.171 ↓ 10.0 10 1

Nested Loop (cost=1.28..264.41 rows=1 width=147) (actual time=0.052..0.171 rows=10 loops=1)

20. 0.005 0.104 ↑ 1.9 23 1

Nested Loop (cost=0.86..244.55 rows=44 width=139) (actual time=0.034..0.104 rows=23 loops=1)

  • Join Filter: (this_.policy_id = ppv3_.policy_id)
21. 0.004 0.059 ↑ 2.0 10 1

Nested Loop (cost=0.43..230.68 rows=20 width=123) (actual time=0.024..0.059 rows=10 loops=1)

22. 0.015 0.015 ↑ 2.7 10 1

Seq Scan on pcy_fleet_join this_ (cost=0.00..2.12 rows=27 width=25) (actual time=0.011..0.015 rows=10 loops=1)

  • Filter: (individual_policy_order = 1)
23. 0.040 0.040 ↑ 1.0 1 10

Index Scan using pk_pcy_policy on pcy_policy pcy1_ (cost=0.43..8.46 rows=1 width=98) (actual time=0.003..0.004 rows=1 loops=10)

  • Index Cond: (id = this_.policy_id)
  • Filter: (((type)::text = 'POLICY'::text) OR ((type)::text = 'REQUEST'::text) OR ((type)::text = 'PROLONGATION'::text))
24. 0.040 0.040 ↑ 1.0 2 10

Index Scan using idx_policy_id on pcy_person_value ppv3_ (cost=0.43..0.67 rows=2 width=24) (actual time=0.003..0.004 rows=2 loops=10)

  • Index Cond: (policy_id = pcy1_.id)
25. 0.069 0.069 ↓ 0.0 0 23

Index Scan using pk_prd_item on prd_item g5_1_ (cost=0.42..0.44 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=23)

  • Index Cond: (id = ppv3_.group_id)
  • Filter: ((alias)::text = 'UBEZPIECZAJACY'::text)
  • Rows Removed by Filter: 1
26. 0.040 0.040 ↑ 1.0 1 10

Index Scan using pk_pcy_policy on pcy_policy off6_ (cost=0.43..8.45 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=10)

  • Index Cond: (id = this_.offer_id)
27. 0.050 0.050 ↑ 1.0 1 10

Index Only Scan using pk_prd_group on prd_group g5_ (cost=0.29..0.30 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=10)

  • Index Cond: (id = ppv3_.group_id)
  • Heap Fetches: 10
28. 0.050 0.050 ↑ 1.0 1 10

Index Scan using pk_prs_person on prs_person prs4_ (cost=0.43..0.47 rows=1 width=70) (actual time=0.005..0.005 rows=1 loops=10)

  • Index Cond: (id = ppv3_.person_id)
29. 0.070 0.070 ↑ 1.0 1 10

Index Scan using pk_prd_product on prd_product prd2_ (cost=0.27..0.29 rows=1 width=11) (actual time=0.002..0.007 rows=1 loops=10)

  • Index Cond: (id = pcy1_.product_id)
30.          

SubPlan (for Nested Loop)

31. 0.010 0.100 ↑ 1.0 1 10

Aggregate (cost=416.89..416.90 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=10)

32. 0.007 0.090 ↑ 49.0 1 10

Nested Loop (cost=0.43..416.77 rows=49 width=12) (actual time=0.006..0.009 rows=1 loops=10)

33. 0.050 0.050 ↑ 49.0 1 10

Seq Scan on pcy_fleet_join pfj1_3 (cost=0.00..2.35 rows=49 width=8) (actual time=0.003..0.005 rows=1 loops=10)

  • Filter: (((general_policy_number IS NOT NULL) AND (general_policy_number = this_.general_policy_number)) OR ((general_policy_number IS NULL) AND (policy_id = this_.policy_id)))
  • Rows Removed by Filter: 19
34. 0.033 0.033 ↑ 1.0 1 11

Index Scan using pk_pcy_policy on pcy_policy pcy1_3 (cost=0.43..8.45 rows=1 width=20) (actual time=0.002..0.003 rows=1 loops=11)

  • Index Cond: (id = pfj1_3.policy_id)
35. 0.020 0.090 ↑ 1.0 1 10

Aggregate (cost=416.89..416.90 rows=1 width=32) (actual time=0.008..0.009 rows=1 loops=10)

36. 0.008 0.070 ↑ 49.0 1 10

Nested Loop (cost=0.43..416.77 rows=49 width=11) (actual time=0.005..0.007 rows=1 loops=10)

37. 0.040 0.040 ↑ 49.0 1 10

Seq Scan on pcy_fleet_join pfj1_4 (cost=0.00..2.35 rows=49 width=8) (actual time=0.002..0.004 rows=1 loops=10)

  • Filter: (((general_policy_number IS NOT NULL) AND (general_policy_number = this_.general_policy_number)) OR ((general_policy_number IS NULL) AND (policy_id = this_.policy_id)))
  • Rows Removed by Filter: 19
38. 0.022 0.022 ↑ 1.0 1 11

Index Scan using pk_pcy_policy on pcy_policy pcy1_4 (cost=0.43..8.45 rows=1 width=19) (actual time=0.002..0.002 rows=1 loops=11)

  • Index Cond: (id = pfj1_4.policy_id)
39. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_prs_address on prs_address address (cost=0.43..8.47 rows=1 width=32) (never executed)

  • Index Cond: (id = prs4_.address_addt)
40. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_prs_address on prs_address address_1 (cost=0.43..8.47 rows=1 width=32) (never executed)

  • Index Cond: (id = prs4_.address_perm)
41. 0.070 0.070 ↑ 1.0 1 10

Index Scan using pk_prs_address on prs_address address_2 (cost=0.43..8.47 rows=1 width=32) (actual time=0.006..0.007 rows=1 loops=10)

  • Index Cond: (id = prs4_.address_corr)
42. 0.010 0.090 ↑ 1.0 1 10

Nested Loop (cost=0.72..16.77 rows=1 width=32) (actual time=0.009..0.009 rows=1 loops=10)

43. 0.020 0.020 ↑ 1.0 1 10

Index Scan using pk_pcy_policy on pcy_policy p (cost=0.43..8.45 rows=1 width=7) (actual time=0.001..0.002 rows=1 loops=10)

  • Index Cond: (id = this_.policy_id)
44. 0.060 0.060 ↑ 1.0 1 10

Index Scan using uq_usr_user_login on usr_user u (cost=0.29..8.31 rows=1 width=23) (actual time=0.006..0.006 rows=1 loops=10)

  • Index Cond: ((login)::text = (p.user_login)::text)
  • Filter: ((jsta IS NOT NULL) AND ((jsta)::text <> ''::text))
  • Rows Removed by Filter: 0
45. 0.002 0.012 ↑ 1.0 1 1

Aggregate (cost=2.29..2.30 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=1)

46. 0.010 0.010 ↑ 33.5 2 1

Seq Scan on pcy_fleet_join pfj (cost=0.00..2.12 rows=67 width=8) (actual time=0.008..0.010 rows=2 loops=1)

  • Filter: (general_policy_number = this_.general_policy_number)
  • Rows Removed by Filter: 18
Planning time : 8.921 ms
Execution time : 1.438 ms