explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hlk

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 30.704 ↑ 1.0 5 1

Limit (cost=613.34..614.62 rows=5 width=165) (actual time=30.698..30.704 rows=5 loops=1)

  • Buffers: shared hit=78 read=33
  • I/O Timings: read=29.797
2. 0.031 30.702 ↑ 61,518.8 5 1

WindowAgg (cost=613.34..78,996.91 rows=307,594 width=165) (actual time=30.697..30.702 rows=5 loops=1)

  • Buffers: shared hit=78 read=33
  • I/O Timings: read=29.797
3. 0.013 30.671 ↑ 34,177.1 9 1

Nested Loop Left Join (cost=613.34..77,920.33 rows=307,594 width=157) (actual time=10.303..30.671 rows=9 loops=1)

  • Buffers: shared hit=78 read=33
  • I/O Timings: read=29.797
4. 0.033 30.649 ↑ 34,177.1 9 1

Nested Loop Left Join (cost=613.26..46,535.62 rows=307,594 width=161) (actual time=10.295..30.649 rows=9 loops=1)

  • Buffers: shared hit=78 read=33
  • I/O Timings: read=29.797
5. 0.033 28.231 ↑ 34,177.1 9 1

Nested Loop (cost=613.20..27,317.77 rows=307,594 width=166) (actual time=9.675..28.231 rows=9 loops=1)

  • Buffers: shared hit=56 read=28
  • I/O Timings: read=27.567
6. 0.024 13.738 ↑ 40.2 6 1

Nested Loop (cost=613.09..1,578.50 rows=241 width=95) (actual time=2.274..13.738 rows=6 loops=1)

  • Buffers: shared hit=38 read=13
  • I/O Timings: read=13.332
7. 9.316 9.316 ↑ 40.2 6 1

CTE Scan on subaccounts (cost=613.01..614.45 rows=241 width=108) (actual time=2.244..9.316 rows=6 loops=1)

  • Buffers: shared hit=17 read=10
  • I/O Timings: read=9.073
8.          

CTE subaccounts

9. 0.022 9.305 ↑ 40.2 6 1

Recursive Union (cost=0.08..613.01 rows=241 width=38) (actual time=2.242..9.305 rows=6 loops=1)

  • Buffers: shared hit=17 read=10
  • I/O Timings: read=9.073
10. 2.239 2.239 ↑ 1.0 1 1

Index Scan using account_sfid_key on account p (cost=0.08..4.09 rows=1 width=38) (actual time=2.238..2.239 rows=1 loops=1)

  • Index Cond: ((sfid)::text = ANY ('{0016000000fgwiEAAQ}'::text[]))
  • Buffers: shared hit=2 read=2
  • I/O Timings: read=2.204
11. 0.021 7.044 ↑ 12.0 2 3

Nested Loop (cost=0.08..60.75 rows=24 width=38) (actual time=1.686..2.348 rows=2 loops=3)

  • Buffers: shared hit=15 read=8
  • I/O Timings: read=6.869
12. 0.003 0.003 ↑ 5.0 2 3

WorkTable Scan on subaccounts s (cost=0.00..0.06 rows=10 width=54) (actual time=0.000..0.001 rows=2 loops=3)

13. 7.020 7.020 ↑ 2.0 1 6

Index Scan using account_parentid_idx on account c (cost=0.08..6.06 rows=2 width=38) (actual time=0.972..1.170 rows=1 loops=6)

  • Index Cond: ((parentid)::text = (s.sfid)::text)
  • Buffers: shared hit=15 read=8
  • I/O Timings: read=6.869
14. 4.398 4.398 ↑ 1.0 1 6

Index Scan using account_sfid_key on account acct (cost=0.08..4.00 rows=1 width=41) (actual time=0.733..0.733 rows=1 loops=6)

  • Index Cond: ((sfid)::text = (subaccounts.sfid)::text)
  • Buffers: shared hit=21 read=3
  • I/O Timings: read=4.259
15. 14.460 14.460 ↑ 638.0 2 6

Index Scan using cpq__c_account__c_idx on cpq__c cpq (cost=0.11..102.97 rows=1,276 width=163) (actual time=1.549..2.410 rows=2 loops=6)

  • Index Cond: ((account__c)::text = (acct.sfid)::text)
  • Buffers: shared hit=18 read=15
  • I/O Timings: read=14.235
16. 2.385 2.385 ↑ 1.0 1 9

Index Scan using user_sfid_key on "user" usr (cost=0.06..0.06 rows=1 width=33) (actual time=0.265..0.265 rows=1 loops=9)

  • Index Cond: ((sfid)::text = (cpq.createdbyid)::text)
  • Buffers: shared hit=22 read=5
  • I/O Timings: read=2.230
17. 0.009 0.009 ↓ 0.0 0 9

Index Scan using contact_sfid_key on contact con (cost=0.08..0.10 rows=1 width=34) (actual time=0.001..0.001 rows=0 loops=9)

  • Index Cond: ((sfid)::text = (cpq.created_by_contact__c)::text)
Planning time : 25.315 ms
Execution time : 30.845 ms