explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DHdX

Settings
# exclusive inclusive rows x rows loops node
1. 159.797 1,933.681 ↓ 0.0 0 1

Insert on companies_persons (cost=6,632.21..98,006.25 rows=28,438 width=16) (actual time=1,933.681..1,933.681 rows=0 loops=1)

  • Conflict Resolution: NOTHING
  • Tuples Inserted: 5019
  • Conflicting Tuples: 439
2. 8.686 1,773.884 ↑ 5.2 5,458 1

Subquery Scan on *SELECT* (cost=6,632.21..98,006.25 rows=28,438 width=16) (actual time=3.259..1,773.884 rows=5,458 loops=1)

3. 5.616 1,765.198 ↑ 5.2 5,458 1

Nested Loop (cost=6,632.21..97,579.68 rows=28,438 width=12) (actual time=3.254..1,765.198 rows=5,458 loops=1)

4.          

CTE matching_companies

5. 7.659 7.978 ↓ 2.0 1,966 1

Index Scan using companies_pkey on companies (cost=98.29..6,598.28 rows=983 width=334) (actual time=0.642..7.978 rows=1,966 loops=1)

  • Index Cond: (id = ANY ('{219800348,219799862,219799452,219799009,219799453,219800349,1527568,2180191,219799876,219800350,219799310,205505799,219799455,219799879,1581887,219799881,219799882,219800476,219800353,219799883,219799023,1514548,219799025,1533212,219799886,136328553,219799028,219799029,219799460,219799461,219799031,219800355,219799462,219799887,219799032,1517211,219800690,219800358,219799889,219799464,219799033,219800359,219800360,219800332,219800328,219799892,219799781,219799618,219799465,219799463,219799427,219799035,219799034,1691698,219799893,219799036,1520382,219799467,219799038,219799468,219799782,219800361,1656418,219800705,219800624,219800542,219800508,219800493,219800325,219800157,219799904,219799851,219799836,219799788,219799731,219799695,219799684,219799660,219799544,219799506,219799505,219799319,219799288,219799279,219799148,219799132,219799109,219799075,219799057,219799020,1564701,160423128,219799443,219799895,74236827,219799896,219799438,219799196,219800365,219799471,219799472,219799898,219799865,219799473,219799899,78858167,1569217,219800749,219800456,219800368,219800367,219800321,219799913,219799737,219799609,219799118,219799091,163283735,219800370,219800369,219799902,219799901,219799835,219799475,219799414,1514787,219799903,219800371,146844714,219799477,219799043,1720016,219799435,219800376,219799905,219799478,219800377,219799479,157663923,219799045,219800220,219799480,219799481,219800378,219799165,219799483,219800380,219799050,219799049,1538453,219799866,219800381,219799051,219800382,219799915,219799914,219799626,1679854,219799943,219799064,219799052,1614512,219799919,219799918,219799917,219799916,1532876,219799920,219800339,219799484,1532237,219799921,219799992,219799485,219799922,219799459,198218970,160425817,160423293,213998353,151466951,151468225,152823703,157664381,219799923,219800386,219799486,219799487,219799489,130575442,1517096,1630120,1739832,1574124,219798985,219800388,219799488,219799058,219800389,219799490,219799059,1621319,219799909,163286486,219800395,219800070,1520485,219799927,219800398,219799168,1518737,219799494,1607313,219799929,219800399,219800327,219800403,219799937,219799935,219799067,1646740,219799936,219799496,145558596,107130748,219799497,219799860,219799070,219800612,219800418,219800402,219800401,219800400,219800316,219800310,219799934,219799933,219799932,219799931,219799930,219799542,219799503,219799071,219799066,219799065,1688210,219800021,219799499,219799073,219800334,219799504,219800616,219799441,219798984,219800320,136348951,219800412,219800413,219799941,219799509,219799215,219800416,219799512,219800417,219799945,219799947,106698569,219800422,219799513,1678691,219800312,219799949,146197910,219800423,219799514,219799515,197471672,202529828,214000399,205504026,159038227,152822579,142372126,140045324,136358956,148819853,129731768,131592076,122505991,121081293,17375691,119216876,133413749,111196187,112072950,42087633,35715944,114714140,89971536,19180320,116943268,35714913,71590586,219799077,219799078,1523812,219800124,219799516,219799952,219799951,219799940,219799517,219799080,219799079,1514145,219799518,219800329,219799953,219800425,219799082,219799428,219799520,219800426,219800702,219800587,219800428,219800427,219800317,219800253,219800086,219799942,219799749,219799551,219799536,219799507,219799201,219799074,219798989,1551094,219799508,219799955,219799084,1603933,219799523,219800729,219800444,219800442,219800439,219800073,219799272,219799096,219799053,1681650,219800734,219800707,219800478,219800433,219800432,219800431,219800430,219800420,219800237,219799990,219799962,219799961,219799960,219799959,219799958,219799946,219799786,219799560,219799558,219799528,219799527,219799526,219799525,219799524,219799187,219799087,219799086,219799085,1686929,219799529,219799530,156977960,219799964,219800440,219800436,219799088,219799532,219799966,219799089,219799967,219799534,1639090,219798998,1535532,219798986,219799535,146842782,136323790,219799972,219799973,219800441,219799094,219799537,219799559,1515494,219799975,219799541,1520285,219799097,219799543,219800333,219799098,219799843,219799099,219799092,219799100,219799978,219799979,219799980,219799102,219799981,219799547,219800447,219799548,1536694,219800466,219800290,1519780,219799983,219800318,219800450,219800385,219799984,219799046,1678956,219799104,219800352,208425844,162556707,197472584,213998364,112510758,208425226,156980365,141752735,132104935,126383255,138205923,123930774,148819730,120606029,16658293,136986380,116944920,107131508,114714777,68184419,150130853,22439699,89971209,144270289,16657908,42086180,31621387,219798995,219799105,219799550,219800522,219800464,219800437,219800002,219800001,219799561,219799167,1610882,219799108,219799110,219799991,219799993,219799112,219799114,219799854,162558651,219799745,219798981,1515146,219799555,219800458,219800459,1815340,219800460,219799115,219799556,150792708,219799116,219799995,219799557,219799997,219800462,219799998,219799999,219799120,205506278,205505503,200340816,202532018,213995730,205502480,203268217,213992559,209158647,213999610,209158646,204007871,213993133,201779531,200340005,208426025,213997625,203270132,213999283,213992513,213993664,209157344,202529278,201778599,213994227,213996858,213998589,213998180,209157343,203270322,204006385,213998564,202529786,213995436,206257166,213997876,203269439,205504189,203268423,205505798,201778703,208424497,200337969,202529722,205506270,208424496,208424494,204008635,213999127,213997031,213995545,213995029,209876145,208425249,219799001,219800463,219800679,219800137,219799492,219799254,219798992,1515800,219799185,219799122,219799125,219799250,1514312,219799562,219800003,219800465,219800004,219799554,78855280,219800005,219799126,219800354,1618289,219799850,219799000,219800467,219800468,219799142,219800008,1593593,219800009,219800469,219799796,219800470,1821436,142374944,219800471,219800013,219799571,219799133,219799572,219799573,219800015,
  • Filter: (NOT (hashed SubPlan 1))
6.          

SubPlan (forIndex Scan)

7. 0.319 0.319 ↓ 0.0 0 1

Seq Scan on hidden_globals (cost=0.00..97.85 rows=5 width=4) (actual time=0.319..0.319 rows=0 loops=1)

  • Filter: (organization_id = 2150)
  • Rows Removed by Filter: 5096
8. 9.842 9.842 ↓ 2.0 1,966 1

CTE Scan on matching_companies (cost=0.00..19.66 rows=983 width=36) (actual time=0.643..9.842 rows=1,966 loops=1)

9. 17.694 1,749.740 ↑ 9.7 3 1,966

Bitmap Heap Scan on persons (cost=33.93..92.24 rows=29 width=48) (actual time=0.884..0.890 rows=3 loops=1,966)

  • Recheck Cond: ((organization_id = 2150) AND (email_domains @> ARRAY[matching_companies.domain]))
  • Heap Blocks: exact=5458
10. 1,732.046 1,732.046 ↑ 9.7 3 1,966

Bitmap Index Scan on persons_organization_id_email_domains_index (cost=0.00..33.92 rows=29 width=0) (actual time=0.881..0.881 rows=3 loops=1,966)

  • Index Cond: ((organization_id = 2150) AND (email_domains @> ARRAY[matching_companies.domain]))