explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oK5M

Settings
# exclusive inclusive rows x rows loops node
1. 0.072 1,172.608 ↓ 2.0 2 1

HashAggregate (cost=1,116,871.78..1,116,871.79 rows=1 width=58) (actual time=1,172.606..1,172.608 rows=2 loops=1)

  • Group Key: wv.name, w.elementid
2.          

CTE most_recent

3. 42.024 1,040.336 ↑ 1.5 2,419 1

HashAggregate (cost=1,107,335.32..1,107,371.40 rows=3,608 width=24) (actual time=1,038.072..1,040.336 rows=2,419 loops=1)

  • Group Key: i_1.id
4. 71.495 998.312 ↑ 1.2 47,508 1

Nested Loop (cost=0.99..1,107,044.78 rows=58,107 width=24) (actual time=1.771..998.312 rows=47,508 loops=1)

5. 788.877 788.877 ↑ 1.5 2,420 1

Index Scan using wfinstances_completed_idx on wfinstances i_1 (cost=0.43..55,780.80 rows=3,608 width=16) (actual time=1.694..788.877 rows=2,420 loops=1)

  • Index Cond: (completed IS NULL)
  • Filter: (companyaccountid = 'c49dcd9e-c1b2-422b-afb5-b643a1d7e27b'::uuid)
  • Rows Removed by Filter: 589402
6. 137.940 137.940 ↑ 16.1 20 2,420

Index Scan using wfinstancelog_instanceid_idx on wfinstancelog w_1 (cost=0.56..288.16 rows=321 width=24) (actual time=0.012..0.057 rows=20 loops=2,420)

  • Index Cond: (instanceid = i_1.id)
7. 56.230 1,172.536 ↓ 35.0 35 1

Nested Loop (cost=1.42..9,500.38 rows=1 width=58) (actual time=1,042.309..1,172.536 rows=35 loops=1)

  • Join Filter: (cf.groupingid = wv.groupingid)
  • Rows Removed by Join Filter: 80220
8. 0.132 1,062.686 ↓ 35.0 35 1

Nested Loop (cost=1.42..9,425.33 rows=1 width=54) (actual time=1,039.577..1,062.686 rows=35 loops=1)

9. 0.296 1,062.414 ↓ 35.0 35 1

Nested Loop (cost=0.99..9,424.27 rows=1 width=54) (actual time=1,039.566..1,062.414 rows=35 loops=1)

10. 2.570 1,061.174 ↓ 118.0 118 1

Nested Loop (cost=0.56..9,422.94 rows=1 width=54) (actual time=1,038.235..1,061.174 rows=118 loops=1)

11. 1,044.090 1,044.090 ↑ 1.5 2,419 1

CTE Scan on most_recent m (cost=0.00..72.16 rows=3,608 width=24) (actual time=1,038.077..1,044.090 rows=2,419 loops=1)

12. 14.514 14.514 ↓ 0.0 0 2,419

Index Scan using wfinstancelog_started_idx on wfinstancelog w (cost=0.56..2.58 rows=1 width=46) (actual time=0.006..0.006 rows=0 loops=2,419)

  • Index Cond: (started = m.started)
  • Filter: ((elementtype = 'TIMEOUT'::text) AND (m.id = instanceid))
  • Rows Removed by Filter: 1
13. 0.944 0.944 ↓ 0.0 0 118

Index Scan using wfinstances_pkey on wfinstances i (cost=0.43..1.32 rows=1 width=32) (actual time=0.008..0.008 rows=0 loops=118)

  • Index Cond: (id = w.instanceid)
  • Filter: (state = 'ACTIVE'::text)
  • Rows Removed by Filter: 1
14. 0.140 0.140 ↑ 1.0 1 35

Index Scan using wfconfigurationdata_pkey on wfconfigurationdata cf (cost=0.42..1.04 rows=1 width=32) (actual time=0.003..0.004 rows=1 loops=35)

  • Index Cond: (id = i.dataid)
15. 53.620 53.620 ↓ 1.0 2,293 35

Seq Scan on wfversions wv (cost=0.00..46.69 rows=2,269 width=36) (actual time=0.002..1.532 rows=2,293 loops=35)

Planning time : 2.672 ms
Execution time : 1,172.911 ms