explain.depesz.com

PostgreSQL's explain analyze made readable

Result: O0fy

Settings
# exclusive inclusive rows x rows loops node
1. 0.043 15,964.368 ↑ 1.0 40 1

Limit (cost=231,787.09..231,787.19 rows=40 width=374) (actual time=15,964.317..15,964.368 rows=40 loops=1)

2.          

CTE persons_term

3. 0.066 16.231 ↓ 1.7 48 1

Bitmap Heap Scan on persons (cost=920.29..1,033.22 rows=28 width=4) (actual time=16.172..16.231 rows=48 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=49
4. 16.165 16.165 ↓ 1.8 49 1

Bitmap Index Scan on persons_new_tsv_index (cost=0.00..920.28 rows=28 width=0) (actual time=16.165..16.165 rows=49 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. 16.898 25.478 ↑ 1.2 8,961 1

Bitmap Heap Scan on companies companies_1 (cost=243.80..38,439.20 rows=10,961 width=4) (actual time=10.390..25.478 rows=8,961 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))
  • Rows Removed by Filter: 10149
  • Heap Blocks: exact=12929
7. 8.580 8.580 ↑ 1.1 19,114 1

Bitmap Index Scan on companies_tsv_index (cost=0.00..241.06 rows=20,408 width=0) (actual time=8.580..8.580 rows=19,114 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.005 0.238 ↓ 0.0 0 1

Bitmap Heap Scan on dropdown_options (cost=28.12..54.63 rows=1 width=4) (actual time=0.238..0.238 rows=0 loops=1)

  • Recheck Cond: ((organization_id = 7) AND (to_tsvector('simple'::regconfig, COALESCE(text, ''::text)) @@ '''venture'':*'::tsquery))
  • Filter: (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[]))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
10. 0.233 0.233 ↑ 12.0 1 1

Bitmap Index Scan on dropdown_options_tsv_index (cost=0.00..28.12 rows=12 width=0) (actual time=0.233..0.233 rows=1 loops=1)

  • Index Cond: ((organization_id = 7) AND (to_tsvector('simple'::regconfig, COALESCE(text, ''::text)) @@ '''venture'':*'::tsquery))
11. 19.620 15,964.325 ↑ 7.8 40 1

Sort (cost=192,260.03..192,260.81 rows=312 width=374) (actual time=15,964.316..15,964.325 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: 38kB
12. 58.938 15,944.705 ↓ 125.2 39,057 1

Hash Left Join (cost=162,827.22..192,250.16 rows=312 width=374) (actual time=15,498.944..15,944.705 rows=39,057 loops=1)

  • Hash Cond: (companies.id = companies_persons_1.company_id)
13. 44.130 15,554.100 ↓ 125.2 39,057 1

Nested Loop (cost=57,710.69..87,129.70 rows=312 width=340) (actual time=15,167.257..15,554.100 rows=39,057 loops=1)

14. 44.107 15,236.291 ↓ 4.7 39,097 1

Hash Join (cost=57,710.27..60,284.80 rows=8,336 width=8) (actual time=15,167.236..15,236.291 rows=39,097 loops=1)

  • Hash Cond: (organizations_relevant_companies.company_id = companies_term.id)
15. 25.034 25.034 ↓ 1.0 94,222 1

Index Only Scan using organizations_relevant_companies_organization_id_company_id_idx on organizations_relevant_companies (cost=0.43..2,332.02 rows=92,547 width=4) (actual time=0.016..25.034 rows=94,222 loops=1)

  • Index Cond: (organization_id = 7)
  • Heap Fetches: 36
16. 13.586 15,167.150 ↓ 4.1 45,688 1

Hash (cost=57,569.89..57,569.89 rows=11,196 width=4) (actual time=15,167.150..15,167.150 rows=45,688 loops=1)

  • Buckets: 65536 (originally 16384) Batches: 1 (originally 1) Memory Usage: 2119kB
17. 32.480 15,153.564 ↓ 4.1 45,688 1

HashAggregate (cost=57,345.97..57,457.93 rows=11,196 width=4) (actual time=15,140.162..15,153.564 rows=45,688 loops=1)

  • Group Key: companies_term.id
18. 17.281 15,121.084 ↓ 4.3 47,662 1

Append (cost=485.32..57,317.98 rows=11,196 width=4) (actual time=53.504..15,121.084 rows=47,662 loops=1)

19. 5.974 56.023 ↑ 1.2 8,973 1

HashAggregate (cost=485.32..594.94 rows=10,962 width=4) (actual time=53.504..56.023 rows=8,973 loops=1)

  • Group Key: companies_term.id
20. 3.415 50.049 ↑ 1.2 9,018 1

Append (cost=0.00..457.92 rows=10,962 width=4) (actual time=10.393..50.049 rows=9,018 loops=1)

21. 30.114 30.114 ↑ 1.2 8,961 1

CTE Scan on companies_term (cost=0.00..219.22 rows=10,961 width=4) (actual time=10.392..30.114 rows=8,961 loops=1)

22. 0.071 16.520 ↓ 57.0 57 1

Nested Loop (cost=0.56..129.08 rows=1 width=4) (actual time=16.186..16.520 rows=57 loops=1)

23. 16.257 16.257 ↓ 1.7 48 1

CTE Scan on persons_term (cost=0.00..0.56 rows=28 width=4) (actual time=16.174..16.257 rows=48 loops=1)

24. 0.192 0.192 ↑ 1.0 1 48

Index Scan using companies_persons_person_id_index on companies_persons (cost=0.56..4.58 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=48)

  • Index Cond: (person_id = persons_term.id)
  • Filter: (organization_id = 7)
25. 14.687 15,047.780 ↓ 165.3 38,689 1

Subquery Scan on t1 (cost=56,496.77..56,501.45 rows=234 width=4) (actual time=15,020.764..15,047.780 rows=38,689 loops=1)

26. 38.090 15,033.093 ↓ 165.3 38,689 1

HashAggregate (cost=56,496.77..56,499.11 rows=234 width=8) (actual time=15,020.763..15,033.093 rows=38,689 loops=1)

  • Group Key: entity_values.company_id, entity_values.list_entry_id
27. 22.975 14,995.003 ↓ 263.4 61,626 1

Append (cost=36,804.75..56,495.60 rows=234 width=8) (actual time=146.367..14,995.003 rows=61,626 loops=1)

28. 0.007 146.367 ↑ 8.0 2 1

HashAggregate (cost=36,804.75..36,804.91 rows=16 width=8) (actual time=146.366..146.367 rows=2 loops=1)

  • Group Key: entity_values.company_id, entity_values.list_entry_id
29. 0.002 146.360 ↑ 8.0 2 1

Append (cost=36,379.70..36,804.67 rows=16 width=8) (actual time=146.117..146.360 rows=2 loops=1)

30. 0.008 146.117 ↑ 7.5 2 1

HashAggregate (cost=36,379.70..36,379.85 rows=15 width=8) (actual time=146.116..146.117 rows=2 loops=1)

  • Group Key: entity_values.company_id, entity_values.list_entry_id
31. 0.002 146.109 ↑ 7.5 2 1

Append (cost=169.70..36,379.62 rows=15 width=8) (actual time=2.050..146.109 rows=2 loops=1)

32. 0.027 3.738 ↑ 1.0 1 1

Nested Loop (cost=169.70..4,808.97 rows=1 width=8) (actual time=2.049..3.738 rows=1 loops=1)

33. 0.015 0.015 ↓ 1.7 48 1

CTE Scan on persons_term persons_term_1 (cost=0.00..0.56 rows=28 width=4) (actual time=0.001..0.015 rows=48 loops=1)

34. 0.048 3.696 ↓ 0.0 0 48

Bitmap Heap Scan on entity_values (cost=169.70..171.72 rows=1 width=12) (actual time=0.077..0.077 rows=0 loops=48)

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

BitmapAnd (cost=169.70..169.70 rows=1 width=0) (actual time=0.076..0.076 rows=0 loops=48)

36. 0.144 0.144 ↓ 0.0 0 48

Bitmap Index Scan on entity_values_value_person_id_index (cost=0.00..38.62 rows=1,074 width=0) (actual time=0.003..0.003 rows=0 loops=48)

  • Index Cond: (value_person_id = persons_term_1.id)
37. 3.468 3.468 ↓ 1.4 8,877 4

Bitmap Index Scan on entity_values_entity_attribute_id_company_id_index (cost=0.00..130.80 rows=6,431 width=0) (actual time=0.867..0.867 rows=8,877 loops=4)

  • Index Cond: (entity_attribute_id = 13499)
38. 0.018 142.369 ↑ 14.0 1 1

Hash Join (cost=30,040.98..31,570.51 rows=14 width=8) (actual time=142.367..142.369 rows=1 loops=1)

  • Hash Cond: (entity_values_1.value_company_id = companies_term_1.id)
39. 0.010 138.134 ↑ 227.0 2 1

Bitmap Heap Scan on entity_values entity_values_1 (cost=29,684.75..30,591.02 rows=454 width=12) (actual time=138.131..138.134 rows=2 loops=1)

  • Recheck Cond: ((entity_attribute_id = ANY ('{120416,77661,115418,118588}'::integer[])) AND (organization_id = 7))
  • Heap Blocks: exact=2
40. 2.782 138.124 ↓ 0.0 0 1

BitmapAnd (cost=29,684.75..29,684.75 rows=454 width=0) (actual time=138.123..138.124 rows=0 loops=1)

41. 0.025 0.025 ↑ 12,861.5 2 1

Bitmap Index Scan on entity_values_entity_attribute_id_company_id_index (cost=0.00..523.20 rows=25,723 width=0) (actual time=0.024..0.025 rows=2 loops=1)

  • Index Cond: (entity_attribute_id = ANY ('{120416,77661,115418,118588}'::integer[]))
42. 135.317 135.317 ↓ 1.0 1,498,227 1

Bitmap Index Scan on entity_values_organization_id_company_id_index (cost=0.00..29,161.08 rows=1,458,201 width=0) (actual time=135.317..135.317 rows=1,498,227 loops=1)

  • Index Cond: (organization_id = 7)
43. 2.169 4.217 ↑ 1.2 8,961 1

Hash (cost=219.22..219.22 rows=10,961 width=4) (actual time=4.217..4.217 rows=8,961 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 444kB
44. 2.048 2.048 ↑ 1.2 8,961 1

CTE Scan on companies_term companies_term_1 (cost=0.00..219.22 rows=10,961 width=4) (actual time=0.001..2.048 rows=8,961 loops=1)

45. 0.001 0.241 ↓ 0.0 0 1

Nested Loop (cost=422.46..424.51 rows=1 width=8) (actual time=0.241..0.241 rows=0 loops=1)

46. 0.240 0.240 ↓ 0.0 0 1

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

47. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on entity_values entity_values_2 (cost=422.46..424.48 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)
48. 0.000 0.000 ↓ 0.0 0

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

49. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on entity_values_value_dropdown_option_id_index (cost=0.00..29.72 rows=1,773 width=0) (never executed)

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

Bitmap Index Scan on entity_values_entity_attribute_id_company_id_index (cost=0.00..392.40 rows=19,292 width=0) (never executed)

  • Index Cond: (entity_attribute_id = ANY ('{105482,108622,117170}'::integer[]))
51. 55.714 14,825.661 ↓ 282.7 61,624 1

Bitmap Heap Scan on entity_values entity_values_3 (cost=18,804.70..19,688.19 rows=218 width=8) (actual time=14,774.359..14,825.661 rows=61,624 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=27269
52. 14,769.947 14,769.947 ↓ 282.8 61,641 1

Bitmap Index Scan on entity_values_tsv_index (cost=0.00..18,804.64 rows=218 width=0) (actual time=14,769.946..14,769.947 rows=61,641 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))
53. 273.679 273.679 ↑ 1.0 1 39,097

Index Scan using companies_pkey on companies (cost=0.43..3.22 rows=1 width=340) (actual time=0.007..0.007 rows=1 loops=39,097)

  • Index Cond: (id = organizations_relevant_companies.company_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
54. 11.229 331.667 ↓ 39.2 40,005 1

Hash (cost=105,103.77..105,103.77 rows=1,020 width=16) (actual time=331.667..331.667 rows=40,005 loops=1)

  • Buckets: 65536 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1968kB
55. 30.947 320.438 ↓ 39.2 40,005 1

Unique (cost=105,088.47..105,093.57 rows=1,020 width=16) (actual time=269.974..320.438 rows=40,005 loops=1)

56. 63.901 289.491 ↓ 100.7 102,685 1

Sort (cost=105,088.47..105,091.02 rows=1,020 width=16) (actual time=269.971..289.491 rows=102,685 loops=1)

  • Sort Key: companies_persons_1.company_id, person_smart_attributes.last_event_date DESC NULLS LAST
  • Sort Method: quicksort Memory: 7886kB
57. 60.798 225.590 ↓ 100.7 102,685 1

Hash Join (cost=99,024.49..105,037.50 rows=1,020 width=16) (actual time=126.934..225.590 rows=102,685 loops=1)

  • Hash Cond: (companies_persons_1.person_id = person_smart_attributes.person_id)
58. 38.004 38.004 ↑ 1.0 102,885 1

Index Only Scan using companies_persons_organization_id_company_id_person_id_index on companies_persons companies_persons_1 (cost=0.56..5,742.16 rows=103,397 width=8) (actual time=0.012..38.004 rows=102,885 loops=1)

  • Index Cond: (organization_id = 7)
  • Heap Fetches: 16860
59. 38.064 126.788 ↑ 1.0 115,946 1

Hash (cost=97,551.93..97,551.93 rows=117,760 width=16) (actual time=126.788..126.788 rows=115,946 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 5256kB
60. 78.627 88.724 ↑ 1.0 115,946 1

Bitmap Heap Scan on person_smart_attributes (cost=2,455.07..97,551.93 rows=117,760 width=16) (actual time=15.825..88.724 rows=115,946 loops=1)

  • Recheck Cond: (organization_id = 7)
  • Heap Blocks: exact=36377
61. 10.097 10.097 ↓ 1.0 118,022 1

Bitmap Index Scan on person_smart_attributes_temp_organization_id_person_id_idx1 (cost=0.00..2,425.63 rows=117,760 width=0) (actual time=10.097..10.097 rows=118,022 loops=1)

  • Index Cond: (organization_id = 7)