explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IaN4

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 11,686.928 ↓ 10.0 10 1

Limit (cost=24,034.83..24,093.84 rows=1 width=296) (actual time=11,686.774..11,686.928 rows=10 loops=1)

  • Output: pcy2_.id, pcy2_.policy_number, pcy2_.creation_date, pcy2_.user_category, pcy2_.user_code, pcy2_.owner_user_code, pcy2_.owner_unit, pcy2_.policy_year, pcy2_.type, pcy2_.subtype, pcy2_.status, pcy2_.cause, pcy2_.protection_start_date, pcy2_.protection_end_date, pcy2_.policy_premium, pcy2_.policy_payment, pcy2_.policy_paid, pcy2_.loss_ratio, prd4_.id, prd4_.name, prd4_.flow_code, pcy2_.flow, (CASE WHEN ((prs1_.person_type)::text = 'INDIVIDUAL'::text) THEN ((((CASE WHEN (prs1_.name IS NULL) THEN ''::character varying ELSE prs1_.name END)::text || ' '::text) || (CASE WHEN (prs1_.surname IS NULL) THEN ''::character varying ELSE prs1_.surname END)::text))::character varying ELSE prs1_.company_name END), (CASE WHEN ((prs1_.address_corr IS NULL) OR (prs1_.address_corr = 0)) THEN CASE WHEN ((prs1_.address_perm IS NULL) OR (prs1_.address_perm = 0)) THEN CASE WHEN ((prs1_.address_addt IS NULL) OR (prs1_.address_addt = 0)) THEN ''::text ELSE (SubPlan 1) END ELSE (SubPlan 2) END ELSE (SubPlan 3) END), pcy2_.unit, pcy2_.has_annex, pcy2_.modification_date, pcy2_1_.pictures_exist, ((SubPlan 4)), ((SubPlan 5)), (CASE WHEN (pcy2_.mandatory_policy IS TRUE) THEN ((((pcy2_.dko_oc)::date + '1 day'::interval))::date - ('now'::cstring)::date) ELSE CASE WHEN ((pcy2_.mandatory_policy IS FALSE) OR (pcy2_.mandatory_policy IS NULL)) THEN ((((pcy2_.protection_end_date)::date + '30 days'::interval))::date - ('now'::cstring)::date) ELSE '-1'::integer END END)
2. 0.032 11,686.922 ↓ 10.0 10 1

Result (cost=24,034.83..24,093.84 rows=1 width=296) (actual time=11,686.770..11,686.922 rows=10 loops=1)

  • Output: pcy2_.id, pcy2_.policy_number, pcy2_.creation_date, pcy2_.user_category, pcy2_.user_code, pcy2_.owner_user_code, pcy2_.owner_unit, pcy2_.policy_year, pcy2_.type, pcy2_.subtype, pcy2_.status, pcy2_.cause, pcy2_.protection_start_date, pcy2_.protection_end_date, pcy2_.policy_premium, pcy2_.policy_payment, pcy2_.policy_paid, pcy2_.loss_ratio, prd4_.id, prd4_.name, prd4_.flow_code, pcy2_.flow, (CASE WHEN ((prs1_.person_type)::text = 'INDIVIDUAL'::text) THEN ((((CASE WHEN (prs1_.name IS NULL) THEN ''::character varying ELSE prs1_.name END)::text || ' '::text) || (CASE WHEN (prs1_.surname IS NULL) THEN ''::character varying ELSE prs1_.surname END)::text))::character varying ELSE prs1_.company_name END), CASE WHEN ((prs1_.address_corr IS NULL) OR (prs1_.address_corr = 0)) THEN CASE WHEN ((prs1_.address_perm IS NULL) OR (prs1_.address_perm = 0)) THEN CASE WHEN ((prs1_.address_addt IS NULL) OR (prs1_.address_addt = 0)) THEN ''::text ELSE (SubPlan 1) END ELSE (SubPlan 2) END ELSE (SubPlan 3) END, pcy2_.unit, pcy2_.has_annex, pcy2_.modification_date, pcy2_1_.pictures_exist, (SubPlan 4), (SubPlan 5), (CASE WHEN (pcy2_.mandatory_policy IS TRUE) THEN ((((pcy2_.dko_oc)::date + '1 day'::interval))::date - ('now'::cstring)::date) ELSE CASE WHEN ((pcy2_.mandatory_policy IS FALSE) OR (pcy2_.mandatory_policy IS NULL)) THEN ((((pcy2_.protection_end_date)::date + '30 days'::interval))::date - ('now'::cstring)::date) ELSE '-1'::integer END END)
3. 0.046 11,686.710 ↓ 10.0 10 1

Sort (cost=24,034.83..24,034.83 rows=1 width=232) (actual time=11,686.709..11,686.710 rows=10 loops=1)

  • Output: pcy2_.id, pcy2_.policy_number, pcy2_.creation_date, pcy2_.user_category, pcy2_.user_code, pcy2_.owner_user_code, pcy2_.owner_unit, pcy2_.policy_year, pcy2_.type, pcy2_.subtype, pcy2_.status, pcy2_.cause, pcy2_.protection_start_date, pcy2_.protection_end_date, pcy2_.policy_premium, pcy2_.policy_payment, pcy2_.policy_paid, pcy2_.loss_ratio, prd4_.id, prd4_.name, prd4_.flow_code, pcy2_.flow, (CASE WHEN ((prs1_.person_type)::text = 'INDIVIDUAL'::text) THEN ((((CASE WHEN (prs1_.name IS NULL) THEN ''::character varying ELSE prs1_.name END)::text || ' '::text) || (CASE WHEN (prs1_.surname IS NULL) THEN ''::character varying ELSE prs1_.surname END)::text))::character varying ELSE prs1_.company_name END), pcy2_.unit, pcy2_.has_annex, pcy2_.modification_date, pcy2_1_.pictures_exist, (CASE WHEN (pcy2_.mandatory_policy IS TRUE) THEN ((((pcy2_.dko_oc)::date + '1 day'::interval))::date - ('now'::cstring)::date) ELSE CASE WHEN ((pcy2_.mandatory_policy IS FALSE) OR (pcy2_.mandatory_policy IS NULL)) THEN ((((pcy2_.protection_end_date)::date + '30 days'::interval))::date - ('now'::cstring)::date) ELSE '-1'::integer END END), prs1_.address_corr, prs1_.address_perm, prs1_.address_addt, this_.policy_id
  • Sort Key: (CASE WHEN (pcy2_.mandatory_policy IS TRUE) THEN ((((pcy2_.dko_oc)::date + '1 day'::interval))::date - ('now'::cstring)::date) ELSE CASE WHEN ((pcy2_.mandatory_policy IS FALSE) OR (pcy2_.mandatory_policy IS NULL)) THEN ((((pcy2_.protection_end_date)::date + '30 days'::interval))::date - ('now'::cstring)::date) ELSE '-1'::integer END END), pcy2_.modification_date DESC
  • Sort Method: quicksort Memory: 29kB
4. 0.057 11,686.664 ↓ 18.0 18 1

Nested Loop (cost=2.42..24,034.82 rows=1 width=232) (actual time=11,639.258..11,686.664 rows=18 loops=1)

  • Output: pcy2_.id, pcy2_.policy_number, pcy2_.creation_date, pcy2_.user_category, pcy2_.user_code, pcy2_.owner_user_code, pcy2_.owner_unit, pcy2_.policy_year, pcy2_.type, pcy2_.subtype, pcy2_.status, pcy2_.cause, pcy2_.protection_start_date, pcy2_.protection_end_date, pcy2_.policy_premium, pcy2_.policy_payment, pcy2_.policy_paid, pcy2_.loss_ratio, prd4_.id, prd4_.name, prd4_.flow_code, pcy2_.flow, CASE WHEN ((prs1_.person_type)::text = 'INDIVIDUAL'::text) THEN ((((CASE WHEN (prs1_.name IS NULL) THEN ''::character varying ELSE prs1_.name END)::text || ' '::text) || (CASE WHEN (prs1_.surname IS NULL) THEN ''::character varying ELSE prs1_.surname END)::text))::character varying ELSE prs1_.company_name END, pcy2_.unit, pcy2_.has_annex, pcy2_.modification_date, pcy2_1_.pictures_exist, CASE WHEN (pcy2_.mandatory_policy IS TRUE) THEN ((((pcy2_.dko_oc)::date + '1 day'::interval))::date - ('now'::cstring)::date) ELSE CASE WHEN ((pcy2_.mandatory_policy IS FALSE) OR (pcy2_.mandatory_policy IS NULL)) THEN ((((pcy2_.protection_end_date)::date + '30 days'::interval))::date - ('now'::cstring)::date) ELSE '-1'::integer END END, prs1_.address_corr, prs1_.address_perm, prs1_.address_addt, this_.policy_id
5. 0.013 11,686.517 ↓ 18.0 18 1

Nested Loop Left Join (cost=2.00..24,034.29 rows=1 width=192) (actual time=11,639.233..11,686.517 rows=18 loops=1)

  • Output: this_.policy_id, this_.person_id, pcy2_.id, pcy2_.policy_number, pcy2_.creation_date, pcy2_.user_category, pcy2_.user_code, pcy2_.owner_user_code, pcy2_.owner_unit, pcy2_.policy_year, pcy2_.type, pcy2_.subtype, pcy2_.status, pcy2_.cause, pcy2_.protection_start_date, pcy2_.protection_end_date, pcy2_.policy_premium, pcy2_.policy_payment, pcy2_.policy_paid, pcy2_.loss_ratio, pcy2_.flow, pcy2_.unit, pcy2_.has_annex, pcy2_.modification_date, pcy2_.mandatory_policy, pcy2_.dko_oc, pcy2_1_.pictures_exist, prd4_.id, prd4_.name, prd4_.flow_code
6. 42.394 11,686.414 ↓ 18.0 18 1

Nested Loop (cost=1.57..24,026.58 rows=1 width=191) (actual time=11,639.216..11,686.414 rows=18 loops=1)

  • Output: this_.policy_id, this_.person_id, pcy2_.id, pcy2_.policy_number, pcy2_.creation_date, pcy2_.user_category, pcy2_.user_code, pcy2_.owner_user_code, pcy2_.owner_unit, pcy2_.policy_year, pcy2_.type, pcy2_.subtype, pcy2_.status, pcy2_.cause, pcy2_.protection_start_date, pcy2_.protection_end_date, pcy2_.policy_premium, pcy2_.policy_payment, pcy2_.policy_paid, pcy2_.loss_ratio, pcy2_.flow, pcy2_.unit, pcy2_.has_annex, pcy2_.modification_date, pcy2_.mandatory_policy, pcy2_.dko_oc, prd4_.id, prd4_.name, prd4_.flow_code
  • Join Filter: ((pcy2_.product_id = prd4_.id) AND (((prd4_.product_class = 'CP'::text) AND ((pcy2_.user_login)::text = '082949'::text)) OR ((prd4_.product_class = 'CC'::text) AND (((pcy2_.unit)::text = '052935'::text) OR ((pcy2_.user_login)::text = '082949'::text))) OR ((prd4_.product_class = 'CP'::text) AND ((pcy2_.owner_user_login)::text = '082949'::text)) OR ((prd4_.product_class = 'CC'::text) AND (((pcy2_.owner_unit)::text = '052935'::text) OR ((pcy2_.owner_user_login)::text = '082949'::text)))) AND CASE WHEN (pcy2_.mandatory_policy IS TRUE) THEN ((('now'::cstring)::date < ((pcy2_.dko_oc)::date + '1 day'::interval)) AND ((((LEAST(pcy2_.protection_start_date, pcy2_.dpo_oc))::date + '1 year'::interval) - (((prd4_.days_to_policy_renewal)::text || ' days'::text))::interval) <= ('now'::cstring)::date)) ELSE CASE WHEN ((pcy2_.mandatory_policy IS FALSE) OR (pcy2_.mandatory_policy IS NULL)) THEN ((('now'::cstring)::date >= (((pcy2_.protection_start_date)::date + '1 year'::interval) - (((prd4_.days_to_policy_renewal)::text || ' days'::text))::interval)) AND ((((pcy2_.protection_start_date)::date + '1 year'::interval) + '30 days'::interval) >= ('now'::cstring)::date)) ELSE false END END)
  • Rows Removed by Join Filter: 231332
7. 0.120 0.120 ↓ 2.4 50 1

Seq Scan on frontend.prd_product prd4_ (cost=0.00..13.29 rows=21 width=34) (actual time=0.027..0.120 rows=50 loops=1)

  • Output: prd4_.id, prd4_.bid, prd4_.root_item_id, prd4_.name, prd4_.code, prd4_.label, prd4_.description, prd4_.date_from, prd4_.date_to, prd4_.version, prd4_.product_class, prd4_.flow_code, prd4_.version_number, prd4_.group_product, prd4_.longterm, prd4_.days_to_offer_expiry, prd4_.days_to_policy_renewal, prd4_.office, prd4_.annex_perspective, prd4_.xls_import, prd4_.calculation_view, prd4_.product_categories, prd4_.ws_export
  • Filter: ((prd4_.days_to_policy_renewal <> '-1'::integer) AND ((prd4_.code)::text = ANY ('{Agro_GM14,rubiAgroEkspert,AutoAssist,AutoAssistDirect,Biznes_Cesja,A15,A15_BGZ,ConcordiaBiznes,ConcordiaDOM,CMD,CP,CBIZwierzeta,DSZ-BB1,MGR,OCBUP,OCCERT,OCPosrednikow,OP,DSZ,SASS,GRKBIndSam}'::text[])))
  • Rows Removed by Filter: 138
8. 12.566 11,643.900 ↓ 257.1 4,627 50

Materialize (cost=1.57..23,963.26 rows=18 width=201) (actual time=12.657..232.878 rows=4,627 loops=50)

  • Output: this_.policy_id, this_.person_id, pcy2_.id, pcy2_.policy_number, pcy2_.creation_date, pcy2_.user_category, pcy2_.user_code, pcy2_.owner_user_code, pcy2_.owner_unit, pcy2_.policy_year, pcy2_.type, pcy2_.subtype, pcy2_.status, pcy2_.cause, pcy2_.protection_start_date, pcy2_.protection_end_date, pcy2_.policy_premium, pcy2_.policy_payment, pcy2_.policy_paid, pcy2_.loss_ratio, pcy2_.flow, pcy2_.unit, pcy2_.has_annex, pcy2_.modification_date, pcy2_.mandatory_policy, pcy2_.dko_oc, pcy2_.product_id, pcy2_.user_login, pcy2_.owner_user_login, pcy2_.dpo_oc
9. 2,248.250 11,631.334 ↓ 257.1 4,627 1

Nested Loop (cost=1.57..23,963.17 rows=18 width=201) (actual time=632.835..11,631.334 rows=4,627 loops=1)

  • Output: this_.policy_id, this_.person_id, pcy2_.id, pcy2_.policy_number, pcy2_.creation_date, pcy2_.user_category, pcy2_.user_code, pcy2_.owner_user_code, pcy2_.owner_unit, pcy2_.policy_year, pcy2_.type, pcy2_.subtype, pcy2_.status, pcy2_.cause, pcy2_.protection_start_date, pcy2_.protection_end_date, pcy2_.policy_premium, pcy2_.policy_payment, pcy2_.policy_paid, pcy2_.loss_ratio, pcy2_.flow, pcy2_.unit, pcy2_.has_annex, pcy2_.modification_date, pcy2_.mandatory_policy, pcy2_.dko_oc, pcy2_.product_id, pcy2_.user_login, pcy2_.owner_user_login, pcy2_.dpo_oc
10. 442.910 2,018.332 ↓ 183.4 3,682,376 1

Nested Loop (cost=1.14..12,973.26 rows=20,073 width=16) (actual time=0.084..2,018.332 rows=3,682,376 loops=1)

  • Output: this_.policy_id, this_.person_id
11. 0.247 1.490 ↓ 8.9 186 1

Nested Loop (cost=0.70..1,163.41 rows=21 width=16) (actual time=0.058..1.490 rows=186 loops=1)

  • Output: g3_.id, g3_1_.id
12. 0.313 0.313 ↑ 1.0 186 1

Index Scan using idx_product_item_alias on frontend.prd_item g3_1_ (cost=0.42..725.29 rows=186 width=8) (actual time=0.030..0.313 rows=186 loops=1)

  • Output: g3_1_.id, g3_1_.bid, g3_1_.parent_item_id, g3_1_.type, g3_1_.code, g3_1_.name, g3_1_.label, g3_1_.alias, g3_1_.description, g3_1_.ordinal_number, g3_1_.date_from, g3_1_.date_to, g3_1_.version, g3_1_.visible, g3_1_.editable, g3_1_.required, g3_1_.path, g3_1_.product_id, g3_1_.renderable
  • Index Cond: ((g3_1_.alias)::text = 'UBEZPIECZAJACY'::text)
13. 0.930 0.930 ↑ 1.0 1 186

Index Only Scan using pk_prd_group on frontend.prd_group g3_ (cost=0.29..2.35 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=186)

  • Output: g3_.id
  • Index Cond: (g3_.id = g3_1_.id)
  • Heap Fetches: 186
14. 1,573.932 1,573.932 ↓ 1.1 19,798 186

Index Scan using idx_group_id on frontend.pcy_person_value this_ (cost=0.43..375.44 rows=18,693 width=24) (actual time=0.009..8.462 rows=19,798 loops=186)

  • Output: this_.id, this_.bid, this_.policy_id, this_.group_id, this_.person_id, this_.date_from, this_.date_to, this_.version, this_.correlation_id, this_.row_number, this_.person_autosave_id
  • Index Cond: (this_.group_id = g3_.id)
15. 7,364.752 7,364.752 ↓ 0.0 0 3,682,376

Index Scan using pk_pcy_policy on frontend.pcy_policy pcy2_ (cost=0.43..0.54 rows=1 width=185) (actual time=0.002..0.002 rows=0 loops=3,682,376)

  • Output: pcy2_.id, pcy2_.bid, pcy2_.id_subrea, pcy2_.type, pcy2_.policy_number, pcy2_.policy_year, pcy2_.barcode, pcy2_.parent_policy_id, pcy2_.product_id, pcy2_.creation_date, pcy2_.modification_date, pcy2_.expiry_date, pcy2_.status, pcy2_.date_from, pcy2_.date_to, pcy2_.version, pcy2_.unit, pcy2_.user_code, pcy2_.user_login, pcy2_.user_representative, pcy2_.user_category, pcy2_.modified, pcy2_.export_id, pcy2_.last_updated_by_user, pcy2_.subtype, pcy2_.cause, pcy2_.general_policy_id, pcy2_.protection_start_date, pcy2_.protection_end_date, pcy2_.policy_premium, pcy2_.policy_payment, pcy2_.edit_operation, pcy2_.policy_paid, pcy2_.actual, pcy2_.status_change_date, pcy2_.calculation_date, pcy2_.edited_policy_id, pcy2_.has_annex, pcy2_.loss_ratio, pcy2_.prediction_calculated, pcy2_.dpo_oc, pcy2_.dko_oc, pcy2_.mandatory_policy, pcy2_.policy_paid_on_time, pcy2_.date_of_agreement_conclusion, pcy2_.automatic_renewal_policy, pcy2_.termination_policy, pcy2_.transfer_of_ownership, pcy2_.doc_receipt_date, pcy2_.verification_date, pcy2_.flow, pcy2_.issue_date, pcy2_.doc_receipt_state, pcy2_.statement_verified, pcy2_.owner_unit, pcy2_.owner_user_login, pcy2_.owner_user_code, pcy2_.owner_user_representative, pcy2_.created_from_category, pcy2_.automatically_renewed, pcy2_.acceptance_date
  • Index Cond: (pcy2_.id = this_.policy_id)
  • Filter: (pcy2_.actual AND ((pcy2_.subtype)::text <> 'RENEWED'::text) AND ((pcy2_.status)::text <> ALL ('{CANCELED,CANCELED_BY_HQ}'::text[])) AND (((pcy2_.type)::text = 'POLICY'::text) OR ((pcy2_.type)::text = 'REQUEST'::text)) AND (((pcy2_.user_login)::text = '082949'::text) OR ((pcy2_.unit)::text = '052935'::text) OR ((pcy2_.user_login)::text = '082949'::text) OR ((pcy2_.owner_user_login)::text = '082949'::text) OR ((pcy2_.owner_unit)::text = '052935'::text) OR ((pcy2_.owner_user_login)::text = '082949'::text)))
  • Rows Removed by Filter: 1
16. 0.090 0.090 ↑ 1.0 1 18

Index Scan using pk_pcy_policy_additional on frontend.pcy_policy_additional pcy2_1_ (cost=0.43..7.69 rows=1 width=9) (actual time=0.005..0.005 rows=1 loops=18)

  • Output: pcy2_1_.id, pcy2_1_.version, pcy2_1_.credit_amount, pcy2_1_.credit_number, pcy2_1_.insurance_amount, pcy2_1_.tariff_name, pcy2_1_.payment_scheme, pcy2_1_.comments, pcy2_1_.participation, pcy2_1_.payment_in_current_month, pcy2_1_.pictures_exist, pcy2_1_.client_id, pcy2_1_.broker_number, pcy2_1_.assignment_operator
  • Index Cond: (pcy2_.id = pcy2_1_.id)
17. 0.090 0.090 ↑ 1.0 1 18

Index Scan using pk_prs_person on frontend.prs_person prs1_ (cost=0.43..0.48 rows=1 width=77) (actual time=0.005..0.005 rows=1 loops=18)

  • Output: prs1_.id, prs1_.bid, prs1_.id_subrea, prs1_.name, prs1_.surname, prs1_.gender, prs1_.nationality, prs1_.company_name, prs1_.company_no, prs1_.nip, prs1_.pid_number, prs1_.pid_type, prs1_.birth_date, prs1_.taxpayer_number, prs1_.phone, prs1_.phone2, prs1_.fax, prs1_.email, prs1_.person_type, prs1_.approval_truestatement, prs1_.approval_sharingdata, prs1_.address_perm, prs1_.address_corr, prs1_.address_addt, prs1_.date_from, prs1_.date_to, prs1_.version, prs1_.pesel, prs1_.person_source, prs1_.middle_name, prs1_.valid_pesel, prs1_.processing_restricted, prs1_.processing_restricted_from, prs1_.processing_restricted_to, prs1_.processing_restricted_login
  • Index Cond: (prs1_.id = this_.person_id)
18.          

SubPlan (for Result)

19. 0.000 0.000 ↓ 0.0 0

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

  • Output: ((((((replace((COALESCE(address.street_prefix, ''::character varying))::text, '-'::text, ''::text) || ' '::text) || (COALESCE(address.street, ''::character varying))::text) || '|'::text) || (COALESCE(address.postcode, ''::character varying))::text) || ' '::text) || (COALESCE(address.post_office, ''::character varying))::text)
  • Index Cond: (address.id = prs1_.address_addt)
20. 0.000 0.000 ↓ 0.0 0

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

  • Output: ((((((replace((COALESCE(address_1.street_prefix, ''::character varying))::text, '-'::text, ''::text) || ' '::text) || (COALESCE(address_1.street, ''::character varying))::text) || '|'::text) || (COALESCE(address_1.postcode, ''::character varying))::text) || ' '::text) || (COALESCE(address_1.post_office, ''::character varying))::text)
  • Index Cond: (address_1.id = prs1_.address_perm)
21. 0.070 0.070 ↑ 1.0 1 10

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

  • Output: ((((((replace((COALESCE(address_2.street_prefix, ''::character varying))::text, '-'::text, ''::text) || ' '::text) || (COALESCE(address_2.street, ''::character varying))::text) || '|'::text) || (COALESCE(address_2.postcode, ''::character varying))::text) || ' '::text) || (COALESCE(address_2.post_office, ''::character varying))::text)
  • Index Cond: (address_2.id = prs1_.address_corr)
22. 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)

  • Output: COALESCE((((u.surname)::text || ' '::text) || (u.name)::text), ' '::text)
23. 0.040 0.040 ↑ 1.0 1 10

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

  • Output: p.id, p.bid, p.id_subrea, p.type, p.policy_number, p.policy_year, p.barcode, p.parent_policy_id, p.product_id, p.creation_date, p.modification_date, p.expiry_date, p.status, p.date_from, p.date_to, p.version, p.unit, p.user_code, p.user_login, p.user_representative, p.user_category, p.modified, p.export_id, p.last_updated_by_user, p.subtype, p.cause, p.general_policy_id, p.protection_start_date, p.protection_end_date, p.policy_premium, p.policy_payment, p.edit_operation, p.policy_paid, p.actual, p.status_change_date, p.calculation_date, p.edited_policy_id, p.has_annex, p.loss_ratio, p.prediction_calculated, p.dpo_oc, p.dko_oc, p.mandatory_policy, p.policy_paid_on_time, p.date_of_agreement_conclusion, p.automatic_renewal_policy, p.termination_policy, p.transfer_of_ownership, p.doc_receipt_date, p.verification_date, p.flow, p.issue_date, p.doc_receipt_state, p.statement_verified, p.owner_unit, p.owner_user_login, p.owner_user_code, p.owner_user_representative, p.created_from_category, p.automatically_renewed, p.acceptance_date
  • Index Cond: (p.id = this_.policy_id)
24. 0.040 0.040 ↑ 1.0 1 10

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

  • Output: u.id, u.login, u.email, u.name, u.surname, u.geo_unit, u.ranumber, u.jsta, u.category, u.subrea_type, u.status, u.organization_id, u.role_id, u.datefrom, u.dateto, u.refgroup, u.version, u.usercompanyname, u.pesel, u.company, u.last_successful_login_date, u.last_unsuccessful_login_date, u.account_creation_date, u.failed_login_count, u.pin_code, u.failed_pin_code_count, u.last_remote_activity, u.password_reset_date, u.nps, u.acceptance_user_organization, u.service_account, u.password
  • Index Cond: ((u.login)::text = (p.user_login)::text)
  • Filter: ((u.jsta IS NOT NULL) AND ((u.jsta)::text <> ''::text))
25. 0.010 0.020 ↓ 0.0 0 10

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

  • Output: COALESCE((((u_1.surname)::text || ' '::text) || (u_1.name)::text), ' '::text)
26. 0.010 0.010 ↑ 1.0 1 10

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

  • Output: p_1.id, p_1.bid, p_1.id_subrea, p_1.type, p_1.policy_number, p_1.policy_year, p_1.barcode, p_1.parent_policy_id, p_1.product_id, p_1.creation_date, p_1.modification_date, p_1.expiry_date, p_1.status, p_1.date_from, p_1.date_to, p_1.version, p_1.unit, p_1.user_code, p_1.user_login, p_1.user_representative, p_1.user_category, p_1.modified, p_1.export_id, p_1.last_updated_by_user, p_1.subtype, p_1.cause, p_1.general_policy_id, p_1.protection_start_date, p_1.protection_end_date, p_1.policy_premium, p_1.policy_payment, p_1.edit_operation, p_1.policy_paid, p_1.actual, p_1.status_change_date, p_1.calculation_date, p_1.edited_policy_id, p_1.has_annex, p_1.loss_ratio, p_1.prediction_calculated, p_1.dpo_oc, p_1.dko_oc, p_1.mandatory_policy, p_1.policy_paid_on_time, p_1.date_of_agreement_conclusion, p_1.automatic_renewal_policy, p_1.termination_policy, p_1.transfer_of_ownership, p_1.doc_receipt_date, p_1.verification_date, p_1.flow, p_1.issue_date, p_1.doc_receipt_state, p_1.statement_verified, p_1.owner_unit, p_1.owner_user_login, p_1.owner_user_code, p_1.owner_user_representative, p_1.created_from_category, p_1.automatically_renewed, p_1.acceptance_date
  • Index Cond: (p_1.id = this_.policy_id)
27. 0.000 0.000 ↓ 0.0 0 10

Index Scan using uq_usr_user_login on frontend.usr_user u_1 (cost=0.29..8.31 rows=1 width=23) (actual time=0.000..0.000 rows=0 loops=10)

  • Output: u_1.id, u_1.login, u_1.email, u_1.name, u_1.surname, u_1.geo_unit, u_1.ranumber, u_1.jsta, u_1.category, u_1.subrea_type, u_1.status, u_1.organization_id, u_1.role_id, u_1.datefrom, u_1.dateto, u_1.refgroup, u_1.version, u_1.usercompanyname, u_1.pesel, u_1.company, u_1.last_successful_login_date, u_1.last_unsuccessful_login_date, u_1.account_creation_date, u_1.failed_login_count, u_1.pin_code, u_1.failed_pin_code_count, u_1.last_remote_activity, u_1.password_reset_date, u_1.nps, u_1.acceptance_user_organization, u_1.service_account, u_1.password
  • Index Cond: ((u_1.login)::text = (p_1.owner_user_login)::text)
  • Filter: ((u_1.jsta IS NOT NULL) AND ((u_1.jsta)::text <> ''::text))
Planning time : 14.773 ms
Execution time : 11,688.166 ms