explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jK9W

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 14,288.165 ↓ 10.0 10 1

Limit (cost=33.93..162,830.66 rows=1 width=370) (actual time=1,388.786..14,288.165 rows=10 loops=1)

2.          

Initplan (for Limit)

3. 0.014 0.072 ↑ 1.0 1 1

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

4. 0.004 0.058 ↓ 7.0 7 1

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

5. 0.033 0.033 ↓ 7.0 7 1

Seq Scan on pcy_fleet_join pfj1 (cost=0.00..2.12 rows=1 width=8) (actual time=0.031..0.033 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.014 0.042 ↑ 1.0 1 1

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

8. 0.006 0.028 ↓ 7.0 7 1

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

9. 0.008 0.008 ↓ 7.0 7 1

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

  • Filter: (general_policy_number = general_policy_number)
  • Rows Removed by Filter: 13
10. 0.014 0.014 ↑ 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.002..0.002 rows=1 loops=7)

  • Index Cond: (id = pfj1_1.policy_id)
11. 0.006 0.037 ↑ 1.0 1 1

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

12. 0.010 0.031 ↓ 7.0 7 1

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

13. 0.007 0.007 ↓ 7.0 7 1

Seq Scan on pcy_fleet_join pfj1_2 (cost=0.00..2.12 rows=1 width=8) (actual time=0.007..0.007 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.979 14,288.155 ↓ 10.0 10 1

Nested Loop (cost=2.14..162,798.87 rows=1 width=370) (actual time=1,388.785..14,288.155 rows=10 loops=1)

  • Join Filter: (pcy1_.product_id = prd2_.id)
  • Rows Removed by Join Filter: 2512
16. 0.062 20.391 ↓ 10.0 10 1

Nested Loop (cost=2.14..719.17 rows=1 width=193) (actual time=1.939..20.391 rows=10 loops=1)

17. 10.056 20.119 ↓ 10.0 10 1

Nested Loop (cost=1.71..718.69 rows=1 width=139) (actual time=1.903..20.119 rows=10 loops=1)

  • Join Filter: (ppv3_.group_id = g5_.id)
  • Rows Removed by Join Filter: 139620
18. 0.070 0.913 ↓ 10.0 10 1

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

19. 0.073 0.773 ↓ 10.0 10 1

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

20. 0.101 0.493 ↑ 1.9 23 1

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

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

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

22. 0.023 0.023 ↑ 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.023 rows=10 loops=1)

  • Filter: (individual_policy_order = 1)
23. 0.130 0.130 ↑ 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.009..0.013 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.160 0.160 ↑ 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.011..0.016 rows=2 loops=10)

  • Index Cond: (policy_id = pcy1_.id)
25. 0.207 0.207 ↓ 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.008..0.009 rows=0 loops=23)

  • Index Cond: (id = ppv3_.group_id)
  • Filter: ((alias)::text = 'UBEZPIECZAJACY'::text)
  • Rows Removed by Filter: 1
26. 0.070 0.070 ↑ 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.007 rows=1 loops=10)

  • Index Cond: (id = this_.offer_id)
27. 9.150 9.150 ↑ 1.0 13,963 10

Seq Scan on prd_group g5_ (cost=0.00..270.92 rows=13,992 width=8) (actual time=0.002..0.915 rows=13,963 loops=10)

28. 0.210 0.210 ↑ 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.014..0.021 rows=1 loops=10)

  • Index Cond: (id = ppv3_.person_id)
29. 0.540 0.540 ↑ 1.1 252 10

Seq Scan on prd_product prd2_ (cost=0.00..17.68 rows=268 width=11) (actual time=0.003..0.054 rows=252 loops=10)

30.          

SubPlan (for Nested Loop)

31. 0.060 0.300 ↑ 1.0 1 10

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

32. 0.076 0.240 ↑ 49.0 1 10

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

33. 0.120 0.120 ↑ 49.0 1 10

Seq Scan on pcy_fleet_join pfj1_3 (cost=0.00..2.35 rows=49 width=8) (actual time=0.009..0.012 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.044 0.044 ↑ 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.004..0.004 rows=1 loops=11)

  • Index Cond: (id = pfj1_3.policy_id)
35. 3,948.640 14,264.870 ↑ 1.0 1 10

Aggregate (cost=161,597.27..161,597.28 rows=1 width=32) (actual time=1,426.487..1,426.487 rows=1 loops=10)

36. 7,114.680 10,316.230 ↓ 1.1 2,809,995 10

Nested Loop (cost=0.00..155,034.64 rows=2,625,053 width=11) (actual time=0.010..1,031.623 rows=2,809,995 loops=10)

37. 0.220 0.220 ↑ 1.0 1 10

Seq Scan on pcy_fleet_join pfj1_4 (cost=0.00..2.58 rows=1 width=0) (actual time=0.003..0.022 rows=1 loops=10)

  • Filter: ((policy_id = policy_id) AND (((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. 3,201.330 3,201.330 ↑ 1.0 2,554,541 11

Seq Scan on pcy_policy pcy1_4 (cost=0.00..128,781.53 rows=2,625,053 width=11) (actual time=0.004..291.030 rows=2,554,541 loops=11)

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.550 0.550 ↑ 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.052..0.055 rows=1 loops=10)

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

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

43. 0.100 0.100 ↑ 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.009..0.010 rows=1 loops=10)

  • Index Cond: (id = this_.policy_id)
44. 0.190 0.190 ↑ 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.019..0.019 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.004 0.035 ↑ 1.0 1 1

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

46. 0.031 0.031 ↑ 33.5 2 1

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

  • Filter: (general_policy_number = this_.general_policy_number)
  • Rows Removed by Filter: 18
Planning time : 15.906 ms
Execution time : 14,288.857 ms