explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Sui1

Settings
# exclusive inclusive rows x rows loops node
1. 8.684 1,528.991 ↑ 1.0 20 1

Subquery Scan on filtered_data (cost=2,827.33..2,837.78 rows=20 width=368) (actual time=1,520.868..1,528.991 rows=20 loops=1)

2. 0.003 1,520.307 ↑ 1.0 20 1

Limit (cost=2,827.33..2,827.38 rows=20 width=304) (actual time=1,520.296..1,520.307 rows=20 loops=1)

3. 5.652 1,520.304 ↑ 10.2 20 1

Sort (cost=2,827.33..2,827.84 rows=204 width=304) (actual time=1,520.295..1,520.304 rows=20 loops=1)

  • Sort Key: delegation_data.entityid DESC
  • Sort Method: top-N heapsort Memory: 30kB
4. 1.274 1,514.652 ↓ 11.9 2,419 1

Subquery Scan on delegation_data (cost=1,514.46..2,821.90 rows=204 width=304) (actual time=3.237..1,514.652 rows=2,419 loops=1)

  • Filter: ((NOT delegation_data.is_workflow_closed) OR (delegation_data.is_workflow_closed IS NULL))
  • Rows Removed by Filter: 21
5. 1,296.311 1,513.378 ↓ 6.0 2,440 1

Hash Left Join (cost=1,514.46..2,817.85 rows=405 width=304) (actual time=3.235..1,513.378 rows=2,440 loops=1)

  • Hash Cond: (du.user_id = au1.id)
6. 2.791 217.061 ↓ 6.0 2,440 1

Nested Loop Left Join (cost=1,506.15..2,278.49 rows=405 width=102) (actual time=2.379..217.061 rows=2,440 loops=1)

7. 210.997 214.270 ↓ 6.0 2,440 1

Nested Loop (cost=1,505.88..1,695.45 rows=405 width=89) (actual time=2.377..214.270 rows=2,440 loops=1)

  • Join Filter: (sourceidfromentityid(rg.entity_type_id, du.entity_id) IS NOT NULL)
8. 0.002 0.047 ↑ 1.0 1 1

Nested Loop (cost=0.27..15.43 rows=1 width=42) (actual time=0.034..0.047 rows=1 loops=1)

9. 0.009 0.009 ↑ 1.0 1 1

Index Scan using pk_role_group on role_group rg (cost=0.27..8.32 rows=1 width=27) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (id = 2056)
  • Filter: ((entity_type_id = 13) AND (client_id = 1005) AND (entity_type_id = ANY ('{1,61,12,13,14,15,16,17,28,18,63,67,80,165,176,181,64}'::integer[])))
10. 0.036 0.036 ↑ 1.0 1 1

Seq Scan on entity_type et (cost=0.00..7.10 rows=1 width=19) (actual time=0.025..0.036 rows=1 loops=1)

  • Filter: (is_workflow_entity AND (id = 13))
  • Rows Removed by Filter: 248
11. 1.326 3.226 ↓ 6.0 2,440 1

Hash Right Join (cost=1,505.60..1,574.21 rows=407 width=51) (actual time=2.072..3.226 rows=2,440 loops=1)

  • Hash Cond: (ddu.domain_user_id = du.id)
12. 0.329 0.329 ↓ 1.0 2,022 1

Seq Scan on delegated_domain_user ddu (cost=0.00..61.06 rows=2,006 width=39) (actual time=0.004..0.329 rows=2,022 loops=1)

13. 0.400 1.571 ↓ 6.0 2,440 1

Hash (cost=1,500.52..1,500.52 rows=407 width=16) (actual time=1.571..1.571 rows=2,440 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 147kB
14. 0.843 1.171 ↓ 6.0 2,440 1

Bitmap Heap Scan on domain_user du (cost=151.53..1,500.52 rows=407 width=16) (actual time=0.353..1.171 rows=2,440 loops=1)

  • Recheck Cond: ((user_id = 1251) AND (role_group_id = 2056))
  • Filter: (NOT entity_deleted)
  • Rows Removed by Filter: 577
  • Heap Blocks: exact=216
15. 0.328 0.328 ↓ 6.7 3,017 1

Bitmap Index Scan on domain_user_user_id_rg_id_entity_id_idx (cost=0.00..151.43 rows=452 width=0) (actual time=0.328..0.328 rows=3,017 loops=1)

  • Index Cond: ((user_id = 1251) AND (role_group_id = 2056))
16. 0.000 0.000 ↓ 0.0 0 2,440

Index Scan using pk_app_user on app_user au2 (cost=0.28..1.43 rows=1 width=21) (actual time=0.000..0.000 rows=0 loops=2,440)

  • Index Cond: (id = ddu.delegated_user_id)
17. 0.001 0.006 ↑ 1.0 1 1

Hash (cost=8.29..8.29 rows=1 width=21) (actual time=0.006..0.006 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.005 0.005 ↑ 1.0 1 1

Index Scan using pk_app_user on app_user au1 (cost=0.28..8.29 rows=1 width=21) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (id = 1251)