explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GBxk

Settings
# exclusive inclusive rows x rows loops node
1. 0.095 2,078.961 ↓ 188.0 188 1

Sort (cost=5,521.96..5,521.97 rows=1 width=244) (actual time=2,078.951..2,078.961 rows=188 loops=1)

  • Sort Key: (count(p2."sourceName")) DESC
  • Sort Method: quicksort Memory: 69kB
2.          

CTE phones

3. 3.860 2,049.933 ↓ 11,798.0 11,798 1

Nested Loop Left Join (cost=4.26..5,521.83 rows=1 width=210) (actual time=2.370..2,049.933 rows=11,798 loops=1)

4. 8.977 2,010.679 ↓ 11,798.0 11,798 1

Nested Loop (cost=3.68..5,518.51 rows=1 width=202) (actual time=2.361..2,010.679 rows=11,798 loops=1)

5. 34.754 1,978.098 ↓ 11,802.0 11,802 1

Nested Loop (cost=3.12..5,515.18 rows=1 width=177) (actual time=2.348..1,978.098 rows=11,802 loops=1)

  • Join Filter: (c.id = cp.companyid)
6. 54.793 1,630.000 ↓ 156,672.0 156,672 1

Nested Loop (cost=2.54..5,511.14 rows=1 width=162) (actual time=0.094..1,630.000 rows=156,672 loops=1)

7. 0.000 941.803 ↓ 158,351.0 158,351 1

Nested Loop (cost=1.97..5,507.82 rows=1 width=138) (actual time=0.076..941.803 rows=158,351 loops=1)

8. 24.606 225.667 ↓ 79,920.7 239,762 1

Nested Loop (cost=1.40..5,497.87 rows=3 width=134) (actual time=0.066..225.667 rows=239,762 loops=1)

9. 0.032 0.032 ↑ 1.0 1 1

Index Scan using idx_domain_rawurl on domain d (cost=0.82..3.84 rows=1 width=134) (actual time=0.029..0.032 rows=1 loops=1)

  • Index Cond: (rawurl = 'salesforce.com'::text)
10. 201.029 201.029 ↓ 50.9 239,762 1

Index Scan using idx_entitydomain_domainid on entitydomain ed_1 (cost=0.57..5,446.96 rows=4,707 width=12) (actual time=0.036..201.029 rows=239,762 loops=1)

  • Index Cond: (domainid = d.id)
  • Filter: (id IS NOT NULL)
11. 719.286 719.286 ↑ 1.0 1 239,762

Index Scan using idx_companyentitydomain_entitydomainid on companyentitydomain ced (cost=0.57..3.31 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=239,762)

  • Index Cond: (entitydomainid = ed_1.id)
12. 633.404 633.404 ↑ 1.0 1 158,351

Index Scan using company_pkey on company c (cost=0.57..3.32 rows=1 width=24) (actual time=0.004..0.004 rows=1 loops=158,351)

  • Index Cond: (id = ced.companyid)
  • Filter: (name ~~* 'Salesforce%'::text)
  • Rows Removed by Filter: 0
13. 313.344 313.344 ↓ 0.0 0 156,672

Index Scan using idx_companyphone_companyid_phoneid_sourceid_updatedat_desc on companyphone cp (cost=0.57..4.02 rows=2 width=31) (actual time=0.002..0.002 rows=0 loops=156,672)

  • Index Cond: (companyid = ced.companyid)
14. 23.604 23.604 ↑ 1.0 1 11,802

Index Scan using phone_pkey on phone p_1 (cost=0.57..3.32 rows=1 width=33) (actual time=0.002..0.002 rows=1 loops=11,802)

  • Index Cond: (id = cp.phoneid)
  • Filter: ((digits !~~ '555%'::text) AND (digits <> ALL ('{1234567890,0000000000,1111111111,2222222222,3333333333,4444444444,5555555555,6666666666,7777777777,8888888888,9999999999,0123456789,0987654321,9876543210}'::text[])))
  • Rows Removed by Filter: 0
15. 35.394 35.394 ↑ 1.0 1 11,798

Index Scan using source_pkey on source s (cost=0.58..3.33 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=11,798)

  • Index Cond: (id = cp.sourceid)
16. 1.066 2,078.866 ↓ 188.0 188 1

Nested Loop (cost=0.07..0.12 rows=1 width=244) (actual time=2,075.833..2,078.866 rows=188 loops=1)

  • Join Filter: (p.digits = p2.digits)
  • Rows Removed by Join Filter: 15,688
17. 13.576 2,072.130 ↓ 126.0 126 1

HashAggregate (cost=0.04..0.05 rows=1 width=236) (actual time=2,072.069..2,072.130 rows=126 loops=1)

  • Group Key: p.digits, p."sourceName
18. 2,058.554 2,058.554 ↓ 11,798.0 11,798 1

CTE Scan on phones p (cost=0.00..0.02 rows=1 width=236) (actual time=2.374..2,058.554 rows=11,798 loops=1)

19. 4.766 5.670 ↓ 126.0 126 126

HashAggregate (cost=0.03..0.04 rows=1 width=72) (actual time=0.030..0.045 rows=126 loops=126)

  • Group Key: p2.digits, p2."sourceName
20. 0.904 0.904 ↓ 11,798.0 11,798 1

CTE Scan on phones p2 (cost=0.00..0.02 rows=1 width=64) (actual time=0.001..0.904 rows=11,798 loops=1)

Planning time : 3.159 ms
Execution time : 2,079.321 ms