explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kgti

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 476,326.740 ↑ 1.0 1 1

Aggregate (cost=411,281.05..411,281.06 rows=1 width=12) (actual time=476,326.740..476,326.740 rows=1 loops=1)

2. 0.006 476,326.730 ↓ 10.0 10 1

Subquery Scan on t (cost=411,281.00..411,281.05 rows=1 width=4) (actual time=476,326.711..476,326.730 rows=10 loops=1)

  • Filter: CASE WHEN ((t.is_allow_lease_progression IS NULL) OR (t.app_id IS NULL)) THEN (t.rank1 = 1) ELSE (t.rank1 IS NOT NULL) END
3. 0.016 476,326.724 ↓ 10.0 10 1

Unique (cost=411,281.00..411,281.03 rows=1 width=87) (actual time=476,326.708..476,326.724 rows=10 loops=1)

4. 0.028 476,326.708 ↓ 10.0 10 1

Sort (cost=411,281.00..411,281.01 rows=1 width=87) (actual time=476,326.707..476,326.708 rows=10 loops=1)

  • Sort Key: (CASE WHEN ((btrim((dp.approvals_esign_docs ->> 'urgent_move_in_date_within'::text)) <> ''::text) AND (ca.lease_start_date <= (CURRENT_DATE + ((dp.approvals_esign_docs ->> 'urgent_move_in_date_within'::text))::integer))) THEN 3 WHEN ((btrim((dp.approvals_esign_docs ->> 'urgent_lease_type_ids'::text)) <> ''::text) AND (ca.lease_interval_type_id = ANY (((dp.approvals_esign_docs ->> 'urgent_lease_type_ids'::text))::integer[]))) THEN 3 WHEN ((btrim((dp.approvals_esign_docs ->> 'urgent_document_signed_since'::text)) <> ''::text) AND (CURRENT_DATE >= ((f.file_signed_on)::date + ((dp.approvals_esign_docs ->> 'urgent_document_signed_since'::text))::integer))) THEN 3 WHEN ((btrim((dp.approvals_esign_docs ->> 'important_document_signed_since'::text)) <> ''::text) AND (CURRENT_DATE >= ((f.file_signed_on)::date + ((dp.approvals_esign_docs ->> 'important_document_signed_since'::text))::integer))) THEN 2 WHEN ((btrim((dp.approvals_esign_docs ->> 'important_lease_type_ids'::text)) <> ''::text) AND (ca.lease_interval_type_id = ANY (((dp.approvals_esign_docs ->> 'important_lease_type_ids'::text))::integer[]))) THEN 2 WHEN ((btrim((dp.approvals_esign_docs ->> 'important_move_in_date_within'::text)) <> ''::text) AND (ca.lease_start_date <= (CURRENT_DATE + ((dp.approvals_esign_docs ->> 'important_move_in_date_within'::text))::integer))) THEN 2 ELSE 1 END), ca.id, f.lease_id, ap.lease_signed_on, f.applicant_id, f.application_id, f.is_allow_lease_progression, f.id, p.property_name, p.id, (rank() OVER (?))
  • Sort Method: quicksort Memory: 26kB
5. 0.028 476,326.680 ↓ 10.0 10 1

WindowAgg (cost=411,280.96..411,280.99 rows=1 width=87) (actual time=476,326.666..476,326.680 rows=10 loops=1)

6. 0.024 476,326.652 ↓ 10.0 10 1

Sort (cost=411,280.96..411,280.97 rows=1 width=79) (actual time=476,326.651..476,326.652 rows=10 loops=1)

  • Sort Key: fa_1.file_id, lc.customer_type_id, lc.id
  • Sort Method: quicksort Memory: 26kB
7. 0.020 476,326.628 ↓ 10.0 10 1

Nested Loop (cost=411,228.00..411,280.95 rows=1 width=79) (actual time=476,310.215..476,326.628 rows=10 loops=1)

8. 0.018 476,316.138 ↓ 10.0 10 1

Nested Loop (cost=411,227.57..411,280.50 rows=1 width=87) (actual time=476,308.888..476,316.138 rows=10 loops=1)

9. 0.015 476,307.580 ↑ 1.6 10 1

Nested Loop (cost=411,227.14..411,273.23 rows=16 width=79) (actual time=476,307.428..476,307.580 rows=10 loops=1)

10. 0.020 476,307.425 ↓ 5.0 10 1

Group (cost=411,226.57..411,226.97 rows=2 width=191) (actual time=476,307.405..476,307.425 rows=10 loops=1)

  • Group Key: ((dp.approvals_esign_docs ->> 'urgent_move_in_date_within'::text)), ((dp.approvals_esign_docs ->> 'urgent_lease_type_ids'::text)), ((dp.approvals_esign_docs ->> 'important_lease_type_ids'::text)), ((dp.approvals_esign_docs ->> 'important_move_in_date_within'::text)), p.id, p.property_name, ca.id, (CASE WHEN ((btrim((dp.approvals_esign_docs ->> 'urgent_move_in_date_within'::text)) <> ''::text) AND (ca.lease_start_date <= (CURRENT_DATE + ((dp.approvals_esign_docs ->> 'urgent_move_in_date_within'::text))::integer))) THEN 3 WHEN ((btrim((dp.approvals_esign_docs ->> 'urgent_lease_type_ids'::text)) <> ''::text) AND (ca.lease_interval_type_id = ANY (((dp.approvals_esign_docs ->> 'urgent_lease_type_ids'::text))::integer[]))) THEN 3 WHEN ((btrim((dp.approvals_esign_docs ->> 'urgent_document_signed_since'::text)) <> ''::text) AND (CURRENT_DATE >= ((f.file_signed_on)::date + ((dp.approvals_esign_docs ->> 'urgent_document_signed_since'::text))::integer))) THEN 3 WHEN ((btrim((dp.approvals_esign_docs ->> 'important_document_signed_since'::text)) <> ''::text) AND (CURRENT_DATE >= ((f.file_signed_on)::date + ((dp.approvals_esign_docs ->> 'important_document_signed_since'::text))::integer))) THEN 2 WHEN ((btrim((dp.approvals_esign_docs ->> 'important_lease_type_ids'::text)) <> ''::text) AND (ca.lease_interval_type_id = ANY (((dp.approvals_esign_docs ->> 'important_lease_type_ids'::text))::integer[]))) THEN 2 WHEN ((btrim((dp.approvals_esign_docs ->> 'important_move_in_date_within'::text)) <> ''::text) AND (ca.lease_start_date <= (CURRENT_DATE + ((dp.approvals_esign_docs ->> 'important_move_in_date_within'::text))::integer))) THEN 2 ELSE 1 END), f.lease_id, f.cid, f.id, ap.lease_signed_on, f.application_id, f.applicant_id, f.is_allow_lease_progression
11. 0.069 476,307.405 ↓ 5.0 10 1

Sort (cost=411,226.57..411,226.58 rows=2 width=191) (actual time=476,307.401..476,307.405 rows=10 loops=1)

  • Sort Key: ((dp.approvals_esign_docs ->> 'urgent_move_in_date_within'::text)), ((dp.approvals_esign_docs ->> 'urgent_lease_type_ids'::text)), ((dp.approvals_esign_docs ->> 'important_lease_type_ids'::text)), ((dp.approvals_esign_docs ->> 'important_move_in_date_within'::text)), p.id, p.property_name, ca.id, (CASE WHEN ((btrim((dp.approvals_esign_docs ->> 'urgent_move_in_date_within'::text)) <> ''::text) AND (ca.lease_start_date <= (CURRENT_DATE + ((dp.approvals_esign_docs ->> 'urgent_move_in_date_within'::text))::integer))) THEN 3 WHEN ((btrim((dp.approvals_esign_docs ->> 'urgent_lease_type_ids'::text)) <> ''::text) AND (ca.lease_interval_type_id = ANY (((dp.approvals_esign_docs ->> 'urgent_lease_type_ids'::text))::integer[]))) THEN 3 WHEN ((btrim((dp.approvals_esign_docs ->> 'urgent_document_signed_since'::text)) <> ''::text) AND (CURRENT_DATE >= ((f.file_signed_on)::date + ((dp.approvals_esign_docs ->> 'urgent_document_signed_since'::text))::integer))) THEN 3 WHEN ((btrim((dp.approvals_esign_docs ->> 'important_document_signed_since'::text)) <> ''::text) AND (CURRENT_DATE >= ((f.file_signed_on)::date + ((dp.approvals_esign_docs ->> 'important_document_signed_since'::text))::integer))) THEN 2 WHEN ((btrim((dp.approvals_esign_docs ->> 'important_lease_type_ids'::text)) <> ''::text) AND (ca.lease_interval_type_id = ANY (((dp.approvals_esign_docs ->> 'important_lease_type_ids'::text))::integer[]))) THEN 2 WHEN ((btrim((dp.approvals_esign_docs ->> 'important_move_in_date_within'::text)) <> ''::text) AND (ca.lease_start_date <= (CURRENT_DATE + ((dp.approvals_esign_docs ->> 'important_move_in_date_within'::text))::integer))) THEN 2 ELSE 1 END), f.lease_id, f.id, ap.lease_signed_on, f.application_id, f.applicant_id, f.is_allow_lease_progression
  • Sort Method: quicksort Memory: 26kB
12. 0.427 476,307.336 ↓ 5.0 10 1

Nested Loop Left Join (cost=407,047.08..411,226.56 rows=2 width=191) (actual time=475,943.304..476,307.336 rows=10 loops=1)

13. 0.059 476,305.719 ↓ 5.0 10 1

Hash Left Join (cost=407,046.95..411,225.84 rows=2 width=75) (actual time=475,942.101..476,305.719 rows=10 loops=1)

  • Hash Cond: (f.id = allowed_files.file_id)
  • Filter: (((allowed_files.file_id IS NOT NULL) AND (0 < allowed_files.addendas_count)) OR (f.document_id IS NULL))
14. 0.035 413.318 ↓ 10.0 10 1

Nested Loop (cost=253.38..4,432.26 rows=1 width=79) (actual time=49.730..413.318 rows=10 loops=1)

15. 0.777 412.383 ↓ 10.0 10 1

Hash Left Join (cost=253.10..4,431.39 rows=1 width=60) (actual time=49.712..412.383 rows=10 loops=1)

  • Hash Cond: ((f.cid = pp.cid) AND (f.property_id = pp.property_id))
  • Filter: ((CASE WHEN (f.is_resident_verify = 1) THEN CASE WHEN (sar.id IS NOT NULL) THEN ((sar.request_status_type_id = 2) AND CASE WHEN (sar.screening_decision_type_id IS NOT NULL) THEN ((sar.screening_decision_type_id <> 3) AND CASE WHEN ((sar.screening_decision_type_id = 2) AND (alternatives: SubPlan 3 or hashed SubPlan 4)) THEN ((ap.lease_signed_on IS NOT NULL) AND (ap.lease_signature IS NOT NULL) AND (ap.lease_ip_address IS NOT NULL)) ELSE true END) ELSE NULL::boolean END) WHEN (sar.id IS NULL) THEN (sar.id IS NULL) ELSE NULL::boolean END ELSE true END AND (((ca.lease_interval_type_id = 1) AND ((SubPlan 5) IS NOT NULL) AND (pp.id IS NOT NULL)) OR (ca.lease_interval_type_id = ANY ('{3,4,5}'::integer[])) OR (pp.id IS NULL)) AND (f.applicant_id <> ALL ('{17731377,17736429,17741395,17756234,17762399,17764600,17764729,17791487,17794074,17811731,17825707,17842401,17848771,17854014,17856304,17871083,17873160,17886116,17886594,17888890,17893816,17899631,17909879,17916356,17923575,17928942,17938111,17943022,17945391,17947958,17959815,17965086,17965758,17968494,17969365,17969851,17972292,17982979,17983309,17985536,17985614,17994152,17994446,17996273}'::integer[])) AND (NOT (alternatives: SubPlan 6 or hashed SubPlan 7)) AND (ca.application_stage_id = 4) AND CASE WHEN (f.is_allow_lease_progression IS NULL) THEN (ca.application_status_id = 3) ELSE ((ca.application_status_id = ANY ('{2,3}'::integer[])) AND (ap.lease_signed_on IS NOT NULL)) END) OR ((ca.id IS NULL) AND (f.file_signed_on IS NOT NULL) AND ((cl.lease_status_type_id = 3) OR (cl.lease_status_type_id = 4))))
  • Rows Removed by Filter: 90
16. 0.214 292.058 ↓ 1.4 100 1

Nested Loop Left Join (cost=1.72..4,179.63 rows=71 width=132) (actual time=8.502..292.058 rows=100 loops=1)

  • Join Filter: (f.cid = sar.cid)
17. 0.316 259.944 ↓ 1.4 100 1

Nested Loop Left Join (cost=1.29..4,146.66 rows=71 width=112) (actual time=7.413..259.944 rows=100 loops=1)

18. 0.273 165.928 ↓ 1.4 100 1

Nested Loop Left Join (cost=0.86..3,957.98 rows=71 width=76) (actual time=5.421..165.928 rows=100 loops=1)

  • Filter: ((ca.lease_interval_type_id IS NOT NULL) OR ((f.application_id IS NULL) AND (alternatives: SubPlan 1 or hashed SubPlan 2)))
  • Rows Removed by Filter: 2
19. 0.267 81.811 ↓ 1.4 102 1

Nested Loop (cost=0.43..200.86 rows=71 width=48) (actual time=1.798..81.811 rows=102 loops=1)

20. 0.250 0.250 ↓ 1.4 102 1

Seq Scan on f (cost=0.00..12.89 rows=71 width=44) (actual time=0.011..0.250 rows=102 loops=1)

  • Filter: ((cid = 3,395) AND ((applicant_id <> ALL ('{17731377,17736429,17741395,17756234,17762399,17764600,17764729,17791487,17794074,17811731,17825707,17842401,17848771,17854014,17856304,17871083,17873160,17886116,17886594,17888890,17893816,17899631,17909879,17916356,17923575,17928942,17938111,17943022,17945391,17947958,17959815,17965086,17965758,17968494,17969365,17969851,17972292,17982979,17983309,17985536,17985614,17994152,17994446,17996273}'::integer[])) OR (file_signed_on IS NOT NULL)))
21. 81.294 81.294 ↑ 1.0 1 102

Index Scan using pk_cached_leases on cached_leases cl (cost=0.43..2.65 rows=1 width=12) (actual time=0.797..0.797 rows=1 loops=102)

  • Index Cond: ((cid = 3,395) AND (id = f.lease_id))
22. 83.844 83.844 ↑ 1.0 1 102

Index Scan using idx_cached_applications_id on cached_applications ca (cost=0.43..2.65 rows=1 width=28) (actual time=0.822..0.822 rows=1 loops=102)

  • Index Cond: (id = f.application_id)
  • Filter: ((cancelled_on IS NULL) AND (cid = 3,395) AND (cid = f.cid))
  • Rows Removed by Filter: 0
23.          

SubPlan (for Nested Loop Left Join)

24. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=3.07..50.25 rows=1 width=0) (never executed)

  • Hash Cond: (cf.file_type_id = ft.id)
25. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_files_file_id on files cf (cost=0.56..47.52 rows=88 width=8) (never executed)

  • Index Cond: ((cid = 3,395) AND (file_id = f.id))
26. 0.000 0.000 ↓ 0.0 0

Hash (cost=2.49..2.49 rows=1 width=8) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_file_types_cid_system_code on file_types ft (cost=0.27..2.49 rows=1 width=8) (never executed)

  • Index Cond: ((cid = 3,395) AND ((system_code)::text = 'SIGNED'::text))
28. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..373,225.20 rows=102,333 width=4) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_file_types_cid_system_code on file_types ft_1 (cost=0.27..2.49 rows=1 width=8) (never executed)

  • Index Cond: ((cid = 3,395) AND ((system_code)::text = 'SIGNED'::text))
30. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_files_cid_file_type_id on files cf_1 (cost=0.56..364,237.89 rows=898,482 width=12) (never executed)

  • Index Cond: ((cid = 3,395) AND (file_type_id = ft_1.id))
31. 93.700 93.700 ↓ 0.0 0 100

Index Scan using uk_applicant_applications_cid_applicant_id_application_id on applicant_applications ap (cost=0.43..2.66 rows=1 width=48) (actual time=0.937..0.937 rows=0 loops=100)

  • Index Cond: ((cid = f.cid) AND (cid = 3,395) AND (applicant_id = f.applicant_id) AND (application_id = f.application_id))
  • Filter: (lease_signed_on IS NOT NULL)
  • Rows Removed by Filter: 1
32. 31.900 31.900 ↓ 0.0 0 100

Index Scan using idx_screening_application_requests_application_id on screening_application_requests sar (cost=0.42..0.45 rows=1 width=20) (actual time=0.319..0.319 rows=0 loops=100)

  • Index Cond: (ca.id = application_id)
  • Filter: (cid = 3,395)
33. 0.001 1.300 ↓ 0.0 0 1

Hash (cost=248.54..248.54 rows=190 width=12) (actual time=1.300..1.300 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
34. 1.299 1.299 ↓ 0.0 0 1

Index Scan using idx_property_preferences_key on property_preferences pp (cost=0.42..248.54 rows=190 width=12) (actual time=1.299..1.299 rows=0 loops=1)

  • Index Cond: ((key)::text = 'REQUIRE_RENTERS_INSURANCE_FOR_LEASE_APPROVAL'::text)
  • Filter: ((value IS NOT NULL) AND (cid = 3,395))
35.          

SubPlan (for Hash Left Join)

36. 4.824 4.824 ↑ 1.0 1 8

Index Scan using idx_screening_application_condition_sets_application_id on screening_application_condition_sets sacs (cost=0.29..2.51 rows=1 width=0) (actual time=0.603..0.603 rows=1 loops=8)

  • Index Cond: (application_id = sar.application_id)
  • Filter: ((satisfied_by IS NULL) AND (satisfied_on IS NULL) AND (cid = sar.cid) AND (is_active = 1))
37. 0.000 0.000 ↓ 0.0 0

Seq Scan on screening_application_condition_sets sacs_1 (cost=0.00..1,110.89 rows=1,688 width=8) (never executed)

  • Filter: ((satisfied_by IS NULL) AND (satisfied_on IS NULL) AND (is_active = 1))
38. 0.164 37.064 ↓ 0.0 0 82

Limit (cost=5.90..5.91 rows=1 width=12) (actual time=0.452..0.452 rows=0 loops=82)

39. 0.410 36.900 ↓ 0.0 0 82

Sort (cost=5.90..5.91 rows=1 width=12) (actual time=0.450..0.450 rows=0 loops=82)

  • Sort Key: sub_rip.id DESC
  • Sort Method: quicksort Memory: 25kB
40. 0.082 36.490 ↓ 0.0 0 82

Nested Loop (cost=0.84..5.89 rows=1 width=12) (actual time=0.445..0.445 rows=0 loops=82)

41. 36.408 36.408 ↓ 0.0 0 82

Index Scan using idx_insurance_policy_customers_lease_id on insurance_policy_customers ipc (cost=0.42..3.25 rows=1 width=8) (actual time=0.444..0.444 rows=0 loops=82)

  • Index Cond: (ca.lease_id = lease_id)
  • Filter: ((cid IS NOT NULL) AND (cid = f.cid) AND (f.application_id = application_id))
  • Rows Removed by Filter: 0
42. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_resident_insurance_policies_id on resident_insurance_policies sub_rip (cost=0.42..2.65 rows=1 width=16) (never executed)

  • Index Cond: (id = ipc.resident_insurance_policy_id)
  • Filter: ((cid = f.cid) AND (insurance_policy_status_type_id = ANY ('{2,3,8}'::integer[])))
43. 76.360 76.360 ↓ 0.0 0 92

Index Scan using idx_applicant_applications_cid_application_id on applicant_applications aa (cost=0.43..3.16 rows=1 width=0) (actual time=0.830..0.830 rows=0 loops=92)

  • Index Cond: ((cid = ca.cid) AND (application_id = ca.id))
  • Filter: ((deleted_on IS NOT NULL) AND (customer_type_id = 1))
  • Rows Removed by Filter: 2
44. 0.000 0.000 ↓ 0.0 0

Gather (cost=1,000.00..124,290.25 rows=94,889 width=8) (never executed)

  • Workers Planned: 2
  • Workers Launched: 0
45. 0.000 0.000 ↓ 0.0 0

Parallel Seq Scan on applicant_applications aa_1 (cost=0.00..113,801.35 rows=39,537 width=8) (never executed)

  • Filter: ((deleted_on IS NOT NULL) AND (customer_type_id = 1))
46. 0.900 0.900 ↑ 1.0 1 10

Index Scan using idx_properties_id on properties p (cost=0.28..0.87 rows=1 width=27) (actual time=0.090..0.090 rows=1 loops=10)

  • Index Cond: (id = f.property_id)
  • Filter: (cid = 3,395)
47. 42.387 475,892.342 ↓ 163.2 170,912 1

Hash (cost=406,780.48..406,780.48 rows=1,047 width=12) (actual time=475,892.342..475,892.342 rows=170,912 loops=1)

  • Buckets: 262,144 (originally 2048) Batches: 1 (originally 1) Memory Usage: 10,060kB
48. 25.993 475,849.955 ↓ 163.2 170,913 1

Subquery Scan on allowed_files (cost=406,751.69..406,780.48 rows=1,047 width=12) (actual time=475,676.396..475,849.955 rows=170,913 loops=1)

49. 102.951 475,823.962 ↓ 163.2 170,913 1

GroupAggregate (cost=406,751.69..406,770.01 rows=1,047 width=12) (actual time=475,676.395..475,823.962 rows=170,913 loops=1)

  • Group Key: f1.file_id
50. 249.975 475,721.011 ↓ 337.8 353,688 1

Sort (cost=406,751.69..406,754.31 rows=1,047 width=8) (actual time=475,676.383..475,721.011 rows=353,688 loops=1)

  • Sort Key: f1.file_id
  • Sort Method: quicksort Memory: 28,868kB
51. 4,105.007 475,471.036 ↓ 337.8 353,688 1

Nested Loop Semi Join (cost=1,560.24..406,699.17 rows=1,047 width=8) (actual time=172.383..475,471.036 rows=353,688 loops=1)

52. 3,567.396 45,195.167 ↓ 106.8 5,463,729 1

Hash Left Join (cost=1,559.67..375,592.14 rows=51,166 width=12) (actual time=42.951..45,195.167 rows=5,463,729 loops=1)

  • Hash Cond: ((f1.cid = da.cid) AND (f1.document_id = da.document_id) AND (f1.document_addenda_id = da.id))
  • Filter: CASE WHEN ((cu.is_administrator = 0) AND (da.countersign_company_group_ids IS NOT NULL)) THEN ((SubPlan 8) && da.countersign_company_group_ids) WHEN ((cu.is_administrator = 1) OR (da.countersign_company_group_ids IS NULL)) THEN true ELSE NULL::boolean END
53. 1,315.120 41,596.507 ↓ 53.4 5,463,729 1

Nested Loop (cost=1.12..373,227.72 rows=102,333 width=32) (actual time=11.487..41,596.507 rows=5,463,729 loops=1)

54. 0.004 1.344 ↑ 1.0 1 1

Nested Loop (cost=0.56..5.01 rows=1 width=20) (actual time=1.341..1.344 rows=1 loops=1)

55. 0.646 0.646 ↑ 1.0 1 1

Index Scan using idx_file_types_cid_system_code on file_types ft1 (cost=0.27..2.49 rows=1 width=8) (actual time=0.645..0.646 rows=1 loops=1)

  • Index Cond: ((cid = 3,395) AND ((system_code)::text = 'LA'::text))
56. 0.694 0.694 ↑ 1.0 1 1

Index Scan using idx_company_users_id on company_users cu (cost=0.29..2.51 rows=1 width=12) (actual time=0.693..0.694 rows=1 loops=1)

  • Index Cond: (id = 100,595)
  • Filter: ((cid = 3,395) AND (company_user_type_id = 2))
57. 40,280.043 40,280.043 ↓ 6.1 5,463,729 1

Index Scan using idx_files_cid_file_type_id on files f1 (cost=0.56..364,237.89 rows=898,482 width=24) (actual time=10.141..40,280.043 rows=5,463,729 loops=1)

  • Index Cond: ((cid = 3,395) AND (file_type_id = ft1.id))
58. 9.900 31.264 ↑ 1.0 31,109 1

Hash (cost=1,014.14..1,014.14 rows=31,109 width=44) (actual time=31.264..31.264 rows=31,109 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,593kB
59. 21.364 21.364 ↑ 1.0 31,109 1

Seq Scan on document_addendas da (cost=0.00..1,014.14 rows=31,109 width=44) (actual time=0.512..21.364 rows=31,109 loops=1)

  • Filter: (cid = 3,395)
  • Rows Removed by Filter: 22
60.          

SubPlan (for Hash Left Join)

61. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_company_user_groups_company_user_id on company_user_groups (cost=0.29..3.18 rows=3 width=4) (never executed)

  • Index Cond: (company_user_id = cu.id)
  • Filter: (cid = cu.cid)
62. 426,170.862 426,170.862 ↓ 0.0 0 5,463,729

Index Scan using idx_file_associations_cid_file_id on file_associations fa1 (cost=0.56..1.40 rows=20 width=8) (actual time=0.078..0.078 rows=0 loops=5,463,729)

  • Index Cond: ((cid = 3,395) AND (file_id = f1.id))
  • Filter: ((deleted_by IS NULL) AND (deleted_on IS NULL) AND (approved_on IS NULL) AND (approved_by IS NULL))
  • Rows Removed by Filter: 2
63. 1.190 1.190 ↑ 1.0 1 10

Index Scan using pk_dashboard_priorities on dashboard_priorities dp (cost=0.13..0.19 rows=1 width=36) (actual time=0.118..0.119 rows=1 loops=10)

  • Index Cond: ((cid = f.cid) AND (cid = 3,395))
64. 0.140 0.140 ↑ 8.0 1 10

Index Scan using idx_file_associations_cid_file_id on file_associations fa_1 (cost=0.56..23.04 rows=8 width=24) (actual time=0.012..0.014 rows=1 loops=10)

  • Index Cond: ((cid = 3,395) AND (file_id = f.id))
  • Filter: (((ca.id = application_id) AND (f.applicant_id = applicant_id)) OR (application_id IS NULL))
  • Rows Removed by Filter: 1
65. 8.540 8.540 ↑ 1.0 1 10

Index Scan using idx_lease_customers_cid_lease_id_customer_id_lease_status_type_ on lease_customers lc (cost=0.43..0.45 rows=1 width=20) (actual time=0.854..0.854 rows=1 loops=10)

  • Index Cond: ((cid = 3,395) AND (lease_id = fa_1.lease_id) AND (customer_id = fa_1.customer_id))
66. 10.470 10.470 ↑ 1.0 1 10

Index Scan using idx_customers_id on customers c (cost=0.43..0.45 rows=1 width=8) (actual time=1.047..1.047 rows=1 loops=10)

  • Index Cond: (id = fa_1.customer_id)
  • Filter: (cid = 3,395)
Planning time : 148.464 ms
Execution time : 476,329.689 ms