explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UivM

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 1,501.059 ↑ 1.0 40 1

Limit (cost=235,763.80..235,763.90 rows=40 width=308) (actual time=1,501.032..1,501.059 rows=40 loops=1)

2.          

CTE persons_term

3. 0.069 4.291 ↑ 1.2 44 1

Bitmap Heap Scan on persons (cost=24.57..246.02 rows=55 width=4) (actual time=4.231..4.291 rows=44 loops=1)

  • Recheck Cond: ((organization_id = 7) AND (((((setweight(to_tsvector('simple'::regconfig, COALESCE(first_name, ''::text)), 'A'::"char") || setweight(to_tsvector('simple'::regconfig, COALESCE(last_name, ''::text)), 'A'::"char")) || setweight(to_tsvector('simple'::regconfig, COALESCE(immutable_array_to_string(nicknames, ' '::text), ''::text)), 'B'::"char")) || setweight(to_tsvector('simple'::regconfig, COALESCE(immutable_array_to_string(emails, ' '::text), ''::text)), 'B'::"char")) || setweight(to_tsvector('simple'::regconfig, COALESCE(immutable_array_to_string(email_domains, ' '::text), ''::text)), 'B'::"char")) @@ '''venture'':*'::tsquery))
  • Heap Blocks: exact=44
4. 4.222 4.222 ↑ 1.2 44 1

Bitmap Index Scan on persons_new_tsv_index (cost=0.00..24.55 rows=55 width=0) (actual time=4.222..4.222 rows=44 loops=1)

  • Index Cond: ((organization_id = 7) AND (((((setweight(to_tsvector('simple'::regconfig, COALESCE(first_name, ''::text)), 'A'::"char") || setweight(to_tsvector('simple'::regconfig, COALESCE(last_name, ''::text)), 'A'::"char")) || setweight(to_tsvector('simple'::regconfig, COALESCE(immutable_array_to_string(nicknames, ' '::text), ''::text)), 'B'::"char")) || setweight(to_tsvector('simple'::regconfig, COALESCE(immutable_array_to_string(emails, ' '::text), ''::text)), 'B'::"char")) || setweight(to_tsvector('simple'::regconfig, COALESCE(immutable_array_to_string(email_domains, ' '::text), ''::text)), 'B'::"char")) @@ '''venture'':*'::tsquery))
5.          

CTE companies_term

6. 10.687 14.722 ↓ 1.4 8,451 1

Bitmap Heap Scan on companies companies_1 (cost=103.53..21,368.04 rows=6,132 width=4) (actual time=5.019..14.722 rows=8,451 loops=1)

  • Recheck Cond: ((setweight(to_tsvector('simple'::regconfig, COALESCE(name, ''::text)), 'A'::"char") || setweight(to_tsvector('simple'::regconfig, COALESCE(domain, ''::text)), 'B'::"char")) @@ '''venture'':*'::tsquery)
  • Filter: ((organization_id = 7) OR (organization_id IS NULL))
  • Heap Blocks: exact=6757
7. 4.035 4.035 ↑ 1.3 8,451 1

Bitmap Index Scan on companies_tsv_index (cost=0.00..102.00 rows=10,667 width=0) (actual time=4.035..4.035 rows=8,451 loops=1)

  • Index Cond: ((setweight(to_tsvector('simple'::regconfig, COALESCE(name, ''::text)), 'A'::"char") || setweight(to_tsvector('simple'::regconfig, COALESCE(domain, ''::text)), 'B'::"char")) @@ '''venture'':*'::tsquery)
8.          

CTE dropdown_options_term

9. 0.002 0.156 ↓ 0.0 0 1

Bitmap Heap Scan on dropdown_options (cost=109.40..111.72 rows=1 width=4) (actual time=0.156..0.156 rows=0 loops=1)

  • Recheck Cond: ((organization_id = 7) AND (to_tsvector('simple'::regconfig, COALESCE(text, ''::text)) @@ '''venture'':*'::tsquery) AND (entity_attribute_id = ANY ('{37445,1286,291,338,1287,2988,2989,1285,1288,130660,120416,73481,60778,10900,13499,1366,77661,105061,105482,107467,107738,108622,113138,114986,115312,115418,116564,117170,118588,118623,121602,123265,123266,123316,125445,129018,129935}'::integer[])))
10. 0.002 0.154 ↓ 0.0 0 1

BitmapAnd (cost=109.40..109.40 rows=1 width=0) (actual time=0.154..0.154 rows=0 loops=1)

11. 0.070 0.070 ↑ 232.0 1 1

Bitmap Index Scan on dropdown_options_tsv_index (cost=0.00..20.32 rows=232 width=0) (actual time=0.070..0.070 rows=1 loops=1)

  • Index Cond: ((organization_id = 7) AND (to_tsvector('simple'::regconfig, COALESCE(text, ''::text)) @@ '''venture'':*'::tsquery))
12. 0.082 0.082 ↑ 19.7 10 1

Bitmap Index Scan on dropdown_options_entity_attribute_id_index (cost=0.00..88.84 rows=197 width=0) (actual time=0.082..0.082 rows=10 loops=1)

  • Index Cond: (entity_attribute_id = ANY ('{37445,1286,291,338,1287,2988,2989,1285,1288,130660,120416,73481,60778,10900,13499,1366,77661,105061,105482,107467,107738,108622,113138,114986,115312,115418,116564,117170,118588,118623,121602,123265,123266,123316,125445,129018,129935}'::integer[]))
13. 20.655 1,501.048 ↑ 666.0 40 1

Sort (cost=214,038.03..214,104.63 rows=26,640 width=308) (actual time=1,501.031..1,501.048 rows=40 loops=1)

  • Sort Key: person_smart_attributes.last_event_date DESC NULLS LAST, ((lower(companies.name) = 'venture'::text)) DESC NULLS LAST, ((lower(companies.domain) = 'venture'::text)) DESC NULLS LAST, companies.id
  • Sort Method: top-N heapsort Memory: 35kB
14. 63.156 1,480.393 ↓ 1.4 38,330 1

Hash Left Join (cost=144,409.46..213,195.95 rows=26,640 width=308) (actual time=853.169..1,480.393 rows=38,330 loops=1)

  • Hash Cond: (companies.id = companies_persons_1.company_id)
15. 34.167 1,124.715 ↓ 1.4 38,330 1

Hash Join (cost=46,052.99..114,473.02 rows=26,640 width=274) (actual time=560.616..1,124.715 rows=38,330 loops=1)

  • Hash Cond: (companies.id = organizations_relevant_companies.company_id)
16. 63.845 1,032.776 ↑ 9.8 44,702 1

Nested Loop (cost=30,258.30..96,767.95 rows=438,398 width=278) (actual time=502.348..1,032.776 rows=44,702 loops=1)

17. 37.407 521.441 ↓ 3.9 44,749 1

HashAggregate (cost=30,257.88..30,373.60 rows=11,572 width=4) (actual time=502.306..521.441 rows=44,749 loops=1)

  • Group Key: companies_term.id
18. 17.978 484.034 ↓ 4.0 46,574 1

Append (cost=445.98..30,228.95 rows=11,572 width=4) (actual time=30.583..484.034 rows=46,574 loops=1)

19. 6.072 33.219 ↓ 1.4 8,463 1

HashAggregate (cost=445.98..507.31 rows=6,133 width=4) (actual time=30.582..33.219 rows=8,463 loops=1)

  • Group Key: companies_term.id
20. 3.268 27.147 ↓ 1.4 8,508 1

Append (cost=0.00..430.64 rows=6,133 width=4) (actual time=5.023..27.147 rows=8,508 loops=1)

21. 19.294 19.294 ↓ 1.4 8,451 1

CTE Scan on companies_term (cost=0.00..122.64 rows=6,132 width=4) (actual time=5.023..19.294 rows=8,451 loops=1)

22. 0.053 4.585 ↓ 57.0 57 1

Nested Loop (cost=0.43..246.68 rows=1 width=4) (actual time=4.254..4.585 rows=57 loops=1)

23. 4.312 4.312 ↑ 1.2 44 1

CTE Scan on persons_term (cost=0.00..1.10 rows=55 width=4) (actual time=4.232..4.312 rows=44 loops=1)

24. 0.220 0.220 ↑ 1.0 1 44

Index Scan using companies_persons_person_id_index on companies_persons (cost=0.43..4.46 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=44)

  • Index Cond: (person_id = persons_term.id)
  • Filter: (organization_id = 7)
25. 14.979 432.837 ↓ 7.0 38,111 1

Subquery Scan on t1 (cost=29,435.81..29,544.59 rows=5,439 width=4) (actual time=404.775..432.837 rows=38,111 loops=1)

26. 38.847 417.858 ↓ 7.0 38,111 1

HashAggregate (cost=29,435.81..29,490.20 rows=5,439 width=8) (actual time=404.775..417.858 rows=38,111 loops=1)

  • Group Key: entity_values.company_id, entity_values.list_entry_id
27. 23.373 379.011 ↓ 11.1 60,407 1

Append (cost=9,491.42..29,408.61 rows=5,439 width=8) (actual time=10.804..379.011 rows=60,407 loops=1)

28. 0.011 10.806 ↑ 5.0 6 1

HashAggregate (cost=9,491.42..9,491.72 rows=30 width=8) (actual time=10.803..10.806 rows=6 loops=1)

  • Group Key: entity_values.company_id, entity_values.list_entry_id
29. 0.004 10.795 ↑ 5.0 6 1

Append (cost=9,461.69..9,491.27 rows=30 width=8) (actual time=10.635..10.795 rows=6 loops=1)

30. 0.008 10.634 ↑ 4.8 6 1

HashAggregate (cost=9,461.69..9,461.98 rows=29 width=8) (actual time=10.634..10.634 rows=6 loops=1)

  • Group Key: entity_values.company_id, entity_values.list_entry_id
31. 0.004 10.626 ↑ 4.8 6 1

Append (cost=105.46..9,461.54 rows=29 width=8) (actual time=2.029..10.626 rows=6 loops=1)

32. 0.044 2.125 ↑ 10.0 1 1

Nested Loop (cost=105.46..5,913.02 rows=10 width=8) (actual time=2.028..2.125 rows=1 loops=1)

33. 0.013 0.013 ↑ 1.2 44 1

CTE Scan on persons_term persons_term_1 (cost=0.00..1.10 rows=55 width=4) (actual time=0.000..0.013 rows=44 loops=1)

34. 0.044 2.068 ↓ 0.0 0 44

Bitmap Heap Scan on entity_values (cost=105.46..107.48 rows=1 width=12) (actual time=0.047..0.047 rows=0 loops=44)

  • Recheck Cond: ((value_person_id = persons_term_1.id) AND (entity_attribute_id = 13499))
  • Filter: (organization_id = 7)
  • Heap Blocks: exact=1
35. 0.016 2.024 ↓ 0.0 0 44

BitmapAnd (cost=105.46..105.46 rows=1 width=0) (actual time=0.046..0.046 rows=0 loops=44)

36. 0.088 0.088 ↓ 0.0 0 44

Bitmap Index Scan on entity_values_value_person_id_index (cost=0.00..3.26 rows=111 width=0) (actual time=0.002..0.002 rows=0 loops=44)

  • Index Cond: (value_person_id = persons_term_1.id)
37. 1.920 1.920 ↑ 1.0 6,773 3

Bitmap Index Scan on entity_values_entity_attribute_id_company_id_index (cost=0.00..101.01 rows=7,011 width=0) (actual time=0.640..0.640 rows=6,773 loops=3)

  • Index Cond: (entity_attribute_id = 13499)
38. 1.585 8.497 ↑ 3.8 5 1

Merge Join (cost=3,512.83..3,548.23 rows=19 width=8) (actual time=5.205..8.497 rows=5 loops=1)

  • Merge Cond: (entity_values_1.value_company_id = companies_term_1.id)
39. 0.020 0.064 ↑ 65.0 14 1

Sort (cost=3,004.42..3,006.70 rows=910 width=12) (actual time=0.058..0.064 rows=14 loops=1)

  • Sort Key: entity_values_1.value_company_id
  • Sort Method: quicksort Memory: 25kB
40. 0.027 0.044 ↑ 65.0 14 1

Bitmap Heap Scan on entity_values entity_values_1 (cost=30.73..2,959.70 rows=910 width=12) (actual time=0.025..0.044 rows=14 loops=1)

  • Recheck Cond: (entity_attribute_id = ANY ('{120416,77661,115418,118588}'::integer[]))
  • Filter: (organization_id = 7)
  • Heap Blocks: exact=12
41. 0.017 0.017 ↑ 121.6 14 1

Bitmap Index Scan on entity_values_entity_attribute_id_company_id_index (cost=0.00..30.50 rows=1,703 width=0) (actual time=0.017..0.017 rows=14 loops=1)

  • Index Cond: (entity_attribute_id = ANY ('{120416,77661,115418,118588}'::integer[]))
42. 4.847 6.848 ↓ 1.2 7,330 1

Sort (cost=508.41..523.74 rows=6,132 width=4) (actual time=5.139..6.848 rows=7,330 loops=1)

  • Sort Key: companies_term_1.id
  • Sort Method: quicksort Memory: 781kB
43. 2.001 2.001 ↓ 1.4 8,451 1

CTE Scan on companies_term companies_term_1 (cost=0.00..122.64 rows=6,132 width=4) (actual time=0.001..2.001 rows=8,451 loops=1)

44. 0.000 0.157 ↓ 0.0 0 1

Nested Loop (cost=26.66..28.71 rows=1 width=8) (actual time=0.157..0.157 rows=0 loops=1)

45. 0.157 0.157 ↓ 0.0 0 1

CTE Scan on dropdown_options_term (cost=0.00..0.02 rows=1 width=4) (actual time=0.157..0.157 rows=0 loops=1)

46. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on entity_values entity_values_2 (cost=26.66..28.68 rows=1 width=12) (never executed)

  • Recheck Cond: ((value_dropdown_option_id = dropdown_options_term.id) AND (entity_attribute_id = ANY ('{105482,108622,117170}'::integer[])))
  • Filter: (organization_id = 7)
47. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=26.66..26.66 rows=1 width=0) (never executed)

48. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on entity_values_value_dropdown_option_id_index (cost=0.00..3.36 rows=143 width=0) (never executed)

  • Index Cond: (value_dropdown_option_id = dropdown_options_term.id)
49. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on entity_values_entity_attribute_id_company_id_index (cost=0.00..22.88 rows=1,278 width=0) (never executed)

  • Index Cond: (entity_attribute_id = ANY ('{105482,108622,117170}'::integer[]))
50. 43.392 344.832 ↓ 11.2 60,401 1

Bitmap Heap Scan on entity_values entity_values_3 (cost=912.97..19,862.20 rows=5,409 width=8) (actual time=303.790..344.832 rows=60,401 loops=1)

  • Recheck Cond: ((organization_id = 7) AND (entity_attribute_id = ANY ('{37445,1286,291,338,1287,2989,1285,1288,73481,10900,1366,105061,107467,107738,113138,114986,115312,116564,118623,121602,123316,125445,129018,129935}'::integer[])) AND ((((((((to_tsvector('simple'::regconfig, COALESCE(value_text, ''::text)) || to_tsvector('simple'::regconfig, COALESCE(value_multiline_text, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_number)::text, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).street_address, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).city, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).state, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).country, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).continent, ''::text))) @@ '''venture'':*'::tsquery) AND ((value_text IS NOT NULL) OR (value_multiline_text IS NOT NULL) OR (value_number IS NOT NULL) OR (NOT (value_location IS NULL))))
  • Heap Blocks: exact=12040
51. 301.440 301.440 ↓ 11.2 60,402 1

Bitmap Index Scan on entity_values_tsv_index (cost=0.00..911.62 rows=5,409 width=0) (actual time=301.440..301.440 rows=60,402 loops=1)

  • Index Cond: ((organization_id = 7) AND (entity_attribute_id = ANY ('{37445,1286,291,338,1287,2989,1285,1288,73481,10900,1366,105061,107467,107738,113138,114986,115312,116564,118623,121602,123316,125445,129018,129935}'::integer[])) AND ((((((((to_tsvector('simple'::regconfig, COALESCE(value_text, ''::text)) || to_tsvector('simple'::regconfig, COALESCE(value_multiline_text, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_number)::text, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).street_address, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).city, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).state, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).country, ''::text))) || to_tsvector('simple'::regconfig, COALESCE((value_location).continent, ''::text))) @@ '''venture'':*'::tsquery))
52. 447.490 447.490 ↑ 1.0 1 44,749

Index Scan using companies_pkey on companies (cost=0.43..5.72 rows=1 width=274) (actual time=0.010..0.010 rows=1 loops=44,749)

  • Index Cond: (id = companies_term.id)
  • Filter: (((organization_id = 7) OR (organization_id IS NULL)) AND (id <> ALL ('{161800872,162557504,58730420,148821180,164006542,1590904,136380421,161850747,161878208,197473816,1780258,164006542,1630399,158344254,1553029,1733171,161818105,149474826,2167322,1514731,148821510,1536609,1527003,1666699,163278493,161870196,1630706,1584523,198234314,113832612,1586770,1706391,163315430,163320504,163320765,163322842,164746678,164737072,164733520,164733961,164734115,164734309,164735094,164735804,164746655,164741776,164742878,164743145,164747090,164755083,164755145,164755541,164755822,164748615,164748490,139436107,164748603,164749651,164750361,179179719,164751166,164752049,164753417,179591941,164757631,164757977,164757888,181632373,177965294,198223188,198224316,198224855,198226126,198229055,198227264,198229129,198228191,198230160,198231459,198233382,198233399,198234591,202533098,100247194,198237641,198247484,115156478,136320326,1806478,138205468,198242396,198247374,198242816,198243714,1785453,198246656,198248892,198249581,201780906,201781137,201781716,201781707,201783550,201784247,1585147,201794464,201794467,201794510,201795343,201795557,201795489,201797787,157664549,201803057,201805258,201805516,201812020,79713712,136324658,157665385,1667614,32735905,116047692,1760595,200341889,147495709,136371828,1794131,201808357,201825951,148157949,1660241,162556406,149474711,1723668,1578758,159035387,201809882,201826124,201810616,201810428,136374187,15941760,136386511,201810828,201826443,136352272,201817530,1636043,197470362,23896956,2177561,1805361,1526673,150129846,1816654,1521927,136378359,32735731,1572766,1723376,136331222,73101444,160423737,136306527,136305978,136317178,1554208,136302354,1815000,148819953,136382832,141754210,136334302,151466576,136303917,116945339,137592338,136301411,127864864,143639337,156979659,141755244,157667126,136354991,1555903,1539960,143638263,136385827,140047509,1637180,122027499,1701562,157664580,1749036,140045838,157665403,136373155,1536036,136374314,148820671,1635673,1546767,136335673,1796456,148158123,136354876,136305402,2184457,132105520,138820356,1575045,1670084,113830985,1797496,1554157,2159279,140046469,1710093,1766864,136301137,136345445,78829480,131082165,142372818,142374005,136319834,164719902,136325866,136334267,136989562,1627272,136350830,1799773,163278087,136379112,136363025,136322667,136331822,136310680,126382328,136352045,136361676,1613667,136323174,2540618,1534626,136302510,136387538,136359272,1795596,1527941,198217342,150127676,136340631,1524310,136366982,136341033,1808715,136352342,1596593,124901747,136316401,152823364,1567305,121554210,144905218,1638412,162556259,137591818,56837525,146196734,163278271,163278276,74998500,120608921,1661672,140047024,1654654,136383897,136362467,1655108,136363843,1763112,136323951,136368143,136317724,136307606,136322019,136354982,1757443,136382926,163278361,136344760,136380306,148154694,1525924,136349969,136338568,136375580,136372374,2539743,1725210,78854802,136363710,136335320,1654273,136989330,1577361,1703153,136363380,198217421,136303759,136346575,198217423,158344784,136347108,136322964,153517007,132105464,78833541,1790813,148155835,144907823,118761440,1798716,1600508,136366309,163278502,148818480,150795784,136326797,137589240,145558604,136340003,136375258,160424243,1803102,141754662,152148243,136383216,1708970,1544388,126876946,78831212,136338684,136345376,136325015,160424658,136315405,2162454,136334198,136355582,1774164,122979742,197470327,128865547,1653719,118306416,200339301,143637341,136334833,136364216,136353944,1636192,37582437,1710367,124902910,1585979,1772094,29774482,200339066,164720149,136318203,1587315,1732111,136356171,1577627,163278785,136324051,1598215,1708583,136312060,136366994,161107983,160425891,136332273,136359536,116944441,136373050,164720189,136312738,136350114,136320119,136345900,136350138,1691438,78836420,157664332,74998663,1524571,136347892,200340391,159036523,148155428,121079667,148158538,1746192,1599645,1786393,136387076,2160687,164720223,120609151,136320431,1555842,150131023,1701028,1515040,154213483,161108349,136319334,112951688,136335773,147494214,136356926,136362629,1812674,136331412,163279076,1700795,2164992,1730765,136324301,1779996,136327236,136316606,122504503,1530271,136323105,136374444,1551865,138205487,136354351,136366275,1516074,154903012,136310844,158343740,128363468,136311584,124904181,153516324,1763605,1748681,136311991,197470507,147495102,1580849,1603519,136323512,2185911,136313936,120610956,136382543,161108139,112951778,154900153,1701958,1628029,1734061,136356272,139435660,143639391,143637709,1795739,164720310,198217662,138204937,146198689,159035484,136302757,136357364,1694878,149474464,136338624,2539254,136311979,1650843,141752599,136380857,144271768,78844509,93392570,147494456,81425899,136356399,136303647,112511693,1631543,1719754,1633002,136340412,136326190,78838072,114714004,136325316,163279418,150130399,1611056,161799896,136314210,148158278,136347680,163279442,136370627,136321052,148156772,152820594,114273034,136334931,136384286,136353550,136352186,142373079,136375392,136352373,136353366,159037964,136353428,136381195,1648397,1763409,1665083,136314117,1805382,136337063,160422933,136363694,136372950,136323472,136311535,78832986,160424599,150128586,2537363,138205472,120608755,1779172,164005744,136352097,136355922,1622227,1592721,1728851,136344442,1548325,146842737,137593249,136987316,143637877,136345184,1733990,1618274,155612379,1691065,136311511,79709329,124897776,136314238,1686213,161109277,1537511,136367373,124900744,136319527,136367230,136308460,60618928,151466723,120600684,136361122,2162973,136364727,2165241,136321229,198217827,136371331,1722021,121080971,136318548,136374145,1690674,138207338,161107229,1531342,144272574,152820489,111195246,163279933,1616636,160425359,1775769,136354370,136339039,136323602,144908244,136310762,136365880,136349908,1520005,136331856,136341869,136362201,1532675,1596575,1546618,15583749,136381160,136375000,157664026,143637959,115602433,136314986,146199441,1575756,136302123,163280105,136356746,150794361,136346119,136344584,144270304,136361170,136320383,1688910,136332947,136334891,136351179,1592303,136353573,136352281,143638280,1585626,159035625,2532925,136342869,1590985,136371689,136384720,136305928,136371120,136320971,1727313,201777379,140659066,120602616,1556310,136362662,159740521,32736828,1789757,1692255,136302212,2179101,136373472,112953479,136354310,163280318,78837459,1662361,116944935,1562723,136360290,139434920,2179615,3236005,164005950,79708815,136350628,136319538,1750912,136363218,1577519,198217967,1586858,159037394,148155760,146844984,1709478,1522323,136313995,1735896,136344323,163280403,120611066,118306048,78862366,136319615,163280445,148155620,1633131,136339487,1624235,115602402,136300867,163280494,136987084,154212516,1662701,1794262,2185848,160425533,2161966,141752555,117847377,136374586,136370739,136355695,6048650,118306912,136306907,136312184,128864951,146844686,1725588,110153420,1577787,148153980,1616065,136330851,136339742,136363723,41332219,136329400,1569889,136336127,136344395,136378020,119672611,163280643,136347618,40577577,136311575,44355752,1751727,1625525,136347837,154212491,163280674,1536268,143003466,1663088,143640756,136340486,136353245,155613087,137592131,113833022,136350497,1747283,148820431,136377475,136302139,153515705,136333528,159738372,136342449,136317780,156297531,136317105,14871546,136306056,159738211,150127806,163280747,150129462,136350276,1799047,158345891,2171806,1538138,136359051,136354704,136374432,136351768,136383600,2171774,1520656,136344234,1521203,136376441,1739851,129730555,136346539,1567713,136322757,1814304,146198609,95532936,136355718,136336216,163280854,1557095,136355632,1790381,136329143,153518290,125885754,136342104,201777539,136364999,136383178,1748251,2164304,136328146,136385094,136355548,74999242,136332470,136332669,136324256,136350940,1754259,121553889,144906421,1730391,1525563,1600443,136331657,1646065,136344609,136388066,144905514,136354902,136310836,152147088,139436238,136370845,146200890,1688971,136336406,1617432,1541502,148153933,136368228,136375998,136312636,151466861,136317180,1745724,156297628,147498390,136364099,1526381,153519006,155615902,1794844,1821912,143006965,79711506,146842952,1801066,78833256,143641128,136386973,133414062,1531150,136338177,136336173,136301302,136366882,144906222,160422752,136350510,136382913,136352274,1658500,138205728,1520949,126384005,78858124,141755272,126383153,136350983,1741720,141752641,1735011,156977803,1683119,129730197,136364545,136326720,1615976,156297134,136340956,120608956,163281257,124905005,136387645,156295933,1654893,123929686,1734157,78830066,1562474,159037241,136360809,136354197,136372271,136352346,200339618,136368806,136325115,136306329,79706364,136322823,136310211,2163108,1589664,1718977,1813836,136311398,136355915,1709165,2537632,74997921,1713934,1532688,154211301,142374127,1711418,136372413,1772863,154906967,1819494,136364664,1548962,1519722,136371770,1707166,1568487,136301099,136343910,136353165,136355699,197471295,156978727,136301323,27927079,1575316,140045890,139436081,136305985,1739493,161109248,1627618,1690059,1577970,78842160,151469214,1799054,136384200,150794892,1813454,1747810,1757321,1728086,136359338,144908187,136335843,143641058,1593341,78841466,163281591,136380755,111635034,33109624,136330518,124901640,2175188,136379843,145561252,74997581,122978115,144907892,159037291,136385197,39078629,201777734,156979244,151467515,1652300,136317484,78842669,1645431,136366251,1738477,136370182,133414452,1649737,1723563,136376842,163281713,163281714,78836953,1681464,157663350,1648170,136341668,136388076,1660521,141755129,2540163,136306620,150795474,1527602,2178357,136352852,158344552,136386660,122977335,136356164,136375335,136370009,147495667,136371958,136334394,1701226,159036774,136339542,152822215}'::integer[])))
  • Rows Removed by Filter: 0
53. 26.892 57.772 ↑ 1.0 89,595 1

Hash (cost=14,635.36..14,635.36 rows=92,746 width=4) (actual time=57.772..57.772 rows=89,595 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4174kB
54. 30.880 30.880 ↑ 1.0 89,595 1

Index Only Scan using organizations_relevant_companies_organization_id_company_id_idx on organizations_relevant_companies (cost=0.43..14,635.36 rows=92,746 width=4) (actual time=0.018..30.880 rows=89,595 loops=1)

  • Index Cond: (organization_id = 7)
  • Heap Fetches: 89595
55. 10.231 292.522 ↓ 40.9 34,810 1

Hash (cost=98,345.83..98,345.83 rows=851 width=16) (actual time=292.522..292.522 rows=34,810 loops=1)

  • Buckets: 65536 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1778kB
56. 27.993 282.291 ↓ 40.9 34,810 1

Unique (cost=98,333.07..98,337.32 rows=851 width=16) (actual time=233.029..282.291 rows=34,810 loops=1)

57. 64.930 254.298 ↓ 107.1 91,161 1

Sort (cost=98,333.07..98,335.20 rows=851 width=16) (actual time=233.028..254.298 rows=91,161 loops=1)

  • Sort Key: companies_persons_1.company_id, person_smart_attributes.last_event_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 7346kB
58. 59.450 189.368 ↓ 107.1 91,161 1

Hash Join (cost=50,643.16..98,291.66 rows=851 width=16) (actual time=91.316..189.368 rows=91,161 loops=1)

  • Hash Cond: (companies_persons_1.person_id = person_smart_attributes.person_id)
59. 41.262 49.258 ↓ 1.0 91,310 1

Bitmap Heap Scan on companies_persons companies_persons_1 (cost=1,411.08..48,709.14 rows=91,180 width=8) (actual time=10.196..49.258 rows=91,310 loops=1)

  • Recheck Cond: (organization_id = 7)
  • Heap Blocks: exact=13563
60. 7.996 7.996 ↓ 1.0 91,312 1

Bitmap Index Scan on companies_persons_organization_id_company_id_person_id_index (cost=0.00..1,388.28 rows=91,180 width=0) (actual time=7.996..7.996 rows=91,312 loops=1)

  • Index Cond: (organization_id = 7)
61. 31.307 80.660 ↓ 1.1 101,364 1

Hash (cost=48,033.74..48,033.74 rows=95,867 width=16) (actual time=80.660..80.660 rows=101,364 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4714kB
62. 41.979 49.353 ↓ 1.1 101,364 1

Bitmap Heap Scan on person_smart_attributes (cost=1,269.40..48,033.74 rows=95,867 width=16) (actual time=8.837..49.353 rows=101,364 loops=1)

  • Recheck Cond: (organization_id = 7)
  • Heap Blocks: exact=9606
63. 7.374 7.374 ↓ 1.1 101,364 1

Bitmap Index Scan on person_smart_attributes_temp_organization_id_person_id_idx1 (cost=0.00..1,245.44 rows=95,867 width=0) (actual time=7.374..7.374 rows=101,364 loops=1)

  • Index Cond: (organization_id = 7)