explain.depesz.com

PostgreSQL's explain analyze made readable

Result: csnE

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 15.222 ↓ 19.0 19 1

Unique (cost=17,167.86..17,167.87 rows=1 width=230) (actual time=15.206..15.222 rows=19 loops=1)

2. 0.051 15.210 ↓ 19.0 19 1

Sort (cost=17,167.86..17,167.87 rows=1 width=230) (actual time=15.206..15.210 rows=19 loops=1)

  • Sort Key: companies_persons.company_id, persons.id, relationship_strengths.internal_person_id, relationship_strengths.strength DESC, persons_global_persons.match_quality DESC
  • Sort Method: quicksort Memory: 34kB
3. 0.027 15.159 ↓ 19.0 19 1

Nested Loop (cost=2.60..17,167.85 rows=1 width=230) (actual time=0.770..15.159 rows=19 loops=1)

4. 0.022 15.056 ↓ 19.0 19 1

Nested Loop (cost=2.17..17,165.76 rows=1 width=161) (actual time=0.762..15.056 rows=19 loops=1)

5. 0.023 14.958 ↓ 19.0 19 1

Nested Loop (cost=1.73..17,163.62 rows=1 width=161) (actual time=0.755..14.958 rows=19 loops=1)

6. 1.608 14.859 ↓ 6.3 19 1

Nested Loop (cost=1.29..17,157.15 rows=3 width=28) (actual time=0.748..14.859 rows=19 loops=1)

7. 1.202 4.584 ↓ 12.2 2,889 1

Nested Loop (cost=0.86..16,464.48 rows=236 width=12) (actual time=0.024..4.584 rows=2,889 loops=1)

8. 0.148 0.148 ↑ 1.0 42 1

Index Only Scan using companies_pkey on companies (cost=0.43..102.69 rows=42 width=4) (actual time=0.008..0.148 rows=42 loops=1)

  • Index Cond: (id = ANY ('{78854841,1516771,1620388,138830168,116496179,161828131,1538177,1514899,1526164,1526317,1527360,1528120,1529127,1530840,1537136,1541917,1542622,1544519,1547035,1548018,1548019,1548096,1553542,1556736,1557210,1557534,1558275,1558529,1560353,1563566,1568993,1569561,1571687,1582235,1595229,1598638,1608020,1613675,1616484,1617661,1623155,1624193}'::integer[]))
  • Heap Fetches: 0
9. 3.234 3.234 ↑ 3.4 69 42

Index Only Scan using companies_persons_company_id_person_id_key on companies_persons (cost=0.43..387.23 rows=234 width=8) (actual time=0.006..0.077 rows=69 loops=42)

  • Index Cond: (company_id = companies.id)
  • Heap Fetches: 2889
10. 8.667 8.667 ↓ 0.0 0 2,889

Index Scan using relationship_strengths_external_person_id_index on relationship_strengths (cost=0.43..2.93 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=2,889)

  • Index Cond: (external_person_id = companies_persons.person_id)
  • Filter: (internal_person_id = ANY ('{10654220,38594,38706,9620297,38600,3598035,138123,11173742,217444,11384922,38596,11098165,12801612,12327774,4827094,9358419,60349,10903848,4327892,12644086,38597,121683,1079068,2403399,38599,9094642,3285886,12895726,1127776,38707,10508528,4769824,38654,6697106,4820338,41789,7873304,14271070,11161089,363372,10726219,287843,2993846,2470455,1426396,4367790,2430195,14269775,14425215,38692,5709010,477400,89734,59321}'::integer[]))
  • Rows Removed by Filter: 1
11. 0.076 0.076 ↑ 1.0 1 19

Index Scan using persons_pkey on persons (cost=0.43..2.15 rows=1 width=133) (actual time=0.004..0.004 rows=1 loops=19)

  • Index Cond: (id = companies_persons.person_id)
  • Filter: (hidden IS FALSE)
12. 0.076 0.076 ↑ 1.0 1 19

Index Scan using persons_global_persons_person_id_global_person_id_key on persons_global_persons (cost=0.43..2.13 rows=1 width=12) (actual time=0.003..0.004 rows=1 loops=19)

  • Index Cond: (person_id = companies_persons.person_id)
13. 0.076 0.076 ↑ 1.0 1 19

Index Scan using persons_metadata_pkey on global_persons (cost=0.43..2.08 rows=1 width=73) (actual time=0.003..0.004 rows=1 loops=19)

  • Index Cond: (id = persons_global_persons.global_person_id)