explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ec8s

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 36,611.683 ↓ 0.0 0 1

Limit (cost=169,968.18..266,521.06 rows=1 width=16) (actual time=36,611.683..36,611.683 rows=0 loops=1)

2. 0.031 36,611.681 ↓ 0.0 0 1

Nested Loop (cost=169,968.18..266,521.06 rows=1 width=16) (actual time=36,611.681..36,611.681 rows=0 loops=1)

  • Join Filter: (c_1.from_companyaccountid = c.from_companyaccountid)
  • Rows Removed by Join Filter: 100
3. 555.056 36,610.936 ↓ 13.2 119 1

Nested Loop (cost=169,967.74..266,508.97 rows=9 width=32) (actual time=34,813.715..36,610.936 rows=119 loops=1)

  • Join Filter: ((cm.value)::text = (cm_1.value)::text)
  • Rows Removed by Join Filter: 4,060,009
4. 443.963 32,407.350 ↑ 1.0 1 1

Limit (cost=169,967.31..169,967.42 rows=1 width=31) (actual time=31,963.389..32,407.350 rows=1 loops=1)

5. 0.000 31,963.387 ↑ 312.0 1 1

Group (cost=169,967.31..169,999.60 rows=312 width=31) (actual time=31,963.387..31,963.387 rows=1 loops=1)

  • Group Key: c_1.from_companyaccountid, cm_1.value
6. 463.440 32,407.302 ↑ 260.0 1 1

Gather Merge (cost=169,967.31..169,998.30 rows=260 width=31) (actual time=31,963.385..32,407.302 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 0.188 31,943.862 ↓ 5.5 717 3 / 3

Group (cost=168,967.29..168,968.27 rows=130 width=31) (actual time=31,943.624..31,943.862 rows=717 loops=3)

  • Group Key: c_1.from_companyaccountid, cm_1.value
8. 128.132 31,943.674 ↓ 5.6 733 3 / 3

Sort (cost=168,967.29..168,967.62 rows=130 width=31) (actual time=31,943.619..31,943.674 rows=733 loops=3)

  • Sort Key: c_1.from_companyaccountid, cm_1.value
  • Sort Method: quicksort Memory: 4,376kB
9. 38.679 31,815.542 ↓ 279.5 36,335 3 / 3

Nested Loop Semi Join (cost=1.43..168,962.73 rows=130 width=31) (actual time=64.231..31,815.542 rows=36,335 loops=3)

  • Join Filter: (cm_1.connectionid = cm_2.connectionid)
10. 849.816 14,222.184 ↓ 16.7 247,249 3 / 3

Nested Loop (cost=0.86..157,205.53 rows=14,770 width=63) (actual time=0.948..14,222.184 rows=247,249 loops=3)

11. 3,898.736 3,898.736 ↓ 28.7 1,353,376 3 / 3

Parallel Index Scan using connectionmetadata_accountsystemid on connectionmetadata cm_1 (cost=0.43..94,467.55 rows=47,136 width=31) (actual time=0.709..3,898.736 rows=1,353,376 loops=3)

12. 9,473.632 9,473.632 ↓ 0.0 0 4,060,128 / 3

Index Scan using connections_pkey on connections c_1 (cost=0.43..1.33 rows=1 width=32) (actual time=0.007..0.007 rows=0 loops=4,060,128)

  • Index Cond: (id = cm_1.connectionid)
  • Filter: ((NOT deleted) AND ((kind)::text = 'c'::text))
  • Rows Removed by Filter: 1
13. 17,554.679 17,554.679 ↓ 0.0 0 741,747 / 3

Index Only Scan using connectionmetadata_pkey on connectionmetadata cm_2 (cost=0.56..0.78 rows=1 width=16) (actual time=0.071..0.071 rows=0 loops=741,747)

  • Index Cond: ((connectionid = c_1.id) AND (key = 'tags'::text) AND (system = true) AND (value = 'CLOUDSCAN_AP_CONNECTION'::text))
  • Filter: system
  • Heap Fetches: 6,378
14. 3,648.530 3,648.530 ↓ 35.9 4,060,128 1

Index Scan using connectionmetadata_accountsystemid on connectionmetadata cm (cost=0.43..95,127.45 rows=113,127 width=31) (actual time=0.022..3,648.530 rows=4,060,128 loops=1)

15. 0.714 0.714 ↑ 1.0 1 119

Index Scan using connections_pkey on connections c (cost=0.43..1.33 rows=1 width=32) (actual time=0.006..0.006 rows=1 loops=119)

  • Index Cond: (id = cm.connectionid)
  • Filter: ((kind)::text = 'e'::text)
  • Rows Removed by Filter: 0