explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xbb5

Settings
# exclusive inclusive rows x rows loops node
1. 0.135 41,097.157 ↓ 12.0 12 1

Limit (cost=35,602.86..35,602.86 rows=1 width=141) (actual time=41,097.021..41,097.157 rows=12 loops=1)

2. 341.811 41,097.022 ↓ 12.0 12 1

Sort (cost=35,602.86..35,602.86 rows=1 width=141) (actual time=41,097.021..41,097.022 rows=12 loops=1)

  • Sort Key: p.id DESC
  • Sort Method: top-N heapsort Memory: 31kB
3. 1,100.344 40,755.211 ↓ 1,193,033.0 1,193,033 1

WindowAgg (cost=1,015.88..35,602.85 rows=1 width=141) (actual time=40,448.878..40,755.211 rows=1,193,033 loops=1)

4. 13,946.850 39,654.867 ↓ 1,193,033.0 1,193,033 1

Nested Loop (cost=1,015.88..35,602.84 rows=1 width=133) (actual time=1,340.494..39,654.867 rows=1,193,033 loops=1)

  • Join Filter: (p.workflow_state_id = ws.id)
  • Rows Removed by Join Filter: 177762929
5. 632.658 12,584.654 ↓ 1,193,033.0 1,193,033 1

Nested Loop (cost=1,015.88..35,561.31 rows=1 width=126) (actual time=1,340.446..12,584.654 rows=1,193,033 loops=1)

6. 1,421.200 9,565.930 ↓ 1,193,033.0 1,193,033 1

Nested Loop (cost=1,015.32..35,556.15 rows=1 width=158) (actual time=1,340.429..9,565.930 rows=1,193,033 loops=1)

7. 0.000 3,372.598 ↓ 1,193,033.0 1,193,033 1

Gather (cost=1,014.89..35,551.58 rows=1 width=105) (actual time=1,340.403..3,372.598 rows=1,193,033 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 3,606.171 3,979.464 ↓ 397,678.0 397,678 3

Nested Loop (cost=14.89..34,551.48 rows=1 width=105) (actual time=1,336.505..3,979.464 rows=397,678 loops=3)

  • -> Index Scan using ix_process_filler_id on process p (cost=0.44..12.80 rows=3 width=56) (actual time=0.003..0.004 rows=0 loops=263898
9. 373.206 373.293 ↓ 879,662.0 879,662 3

Hash Join (cost=14.45..34,538.65 rows=1 width=65) (actual time=0.190..373.293 rows=879,662 loops=3)

  • Hash Cond: (oa.operation_entity_id = e1.id)
  • -> Parallel Seq Scan on operation_account oa (cost=0.00..30400.78 rows=1099578 width=16) (actual time=0.030..117.331 rows=879662
  • Index Cond: (filler_id = oa.account_entity_id)
  • Filter: (process_template_id = ANY ('{89,112}'::bigint[]))
  • Rows Removed by Filter: 1
10. 0.003 0.087 ↑ 1.0 1 3

Hash (cost=14.44..14.44 rows=1 width=65) (actual time=0.087..0.087 rows=1 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.036 0.084 ↑ 1.0 1 3

Nested Loop (cost=6.40..14.44 rows=1 width=65) (actual time=0.083..0.084 rows=1 loops=3)

  • -> Index Scan using idx_entity_uuid on entity e1 (cost=0.43..8.45 rows=1 width=49) (actual time=0.030..0.030 rows=1
12. 0.003 0.048 ↑ 1.0 1 3

HashAggregate (cost=5.97..5.98 rows=1 width=16) (actual time=0.048..0.048 rows=1 loops=3)

  • Group Key: acl.entity_id_uuid
  • Index Cond: (id_uuid = acl.entity_id_uuid)
13. 0.045 0.045 ↑ 1.0 1 3

Seq Scan on entity_acl acl (cost=0.00..5.97 rows=1 width=16) (actual time=0.044..0.045 rows=1 loops=3)

  • Filter: ((user_or_group_id = '1184936'::bigint) AND (account_type_id = 6))
  • Rows Removed by Filter: 197
14. 4,772.132 4,772.132 ↑ 1.0 1 1,193,033

Index Scan using idx_entity_uuid on entity e (cost=0.43..4.56 rows=1 width=69) (actual time=0.004..0.004 rows=1 loops=1,193,033)

  • Index Cond: (id_uuid = p.filler_id_uuid)
15. 2,386.066 2,386.066 ↑ 1.0 1 1,193,033

Index Scan using idx_process_filler_id_uuid on process p2 (cost=0.56..5.16 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=1,193,033)

  • Index Cond: (filler_id_uuid = e1.id_uuid)
  • Filter: (workflow_state_id = ANY ('{264,265}'::bigint[]))
16. 13,123.363 13,123.363 ↑ 4.0 150 1,193,033

Seq Scan on workflow_state ws (cost=0.00..34.01 rows=601 width=23) (actual time=0.001..0.011 rows=150 loops=1,193,033)