explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0Ez

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 58.746 ↓ 2.5 20 1

Limit (cost=5,487.56..5,491.74 rows=8 width=399) (actual time=48.561..58.746 rows=20 loops=1)

2. 10.848 58.733 ↓ 2.5 20 1

Result (cost=5,487.56..5,491.74 rows=8 width=399) (actual time=48.557..58.733 rows=20 loops=1)

3. 0.193 47.885 ↓ 2.5 20 1

Sort (cost=5,487.56..5,487.58 rows=8 width=335) (actual time=47.870..47.885 rows=20 loops=1)

  • Sort Key: ddu.date_modified DESC
  • Sort Method: quicksort Memory: 35kB
4. 41.704 47.692 ↓ 4.9 39 1

Nested Loop Left Join (cost=5,382.97..5,487.36 rows=8 width=335) (actual time=7.827..47.692 rows=39 loops=1)

5. 0.075 5.754 ↓ 4.9 39 1

Nested Loop Left Join (cost=5,382.70..5,472.94 rows=8 width=102) (actual time=3.786..5.754 rows=39 loops=1)

6. 0.094 5.484 ↓ 4.9 39 1

Nested Loop Left Join (cost=5,382.42..5,461.42 rows=8 width=89) (actual time=3.778..5.484 rows=39 loops=1)

7. 0.084 5.234 ↓ 4.9 39 1

Nested Loop (cost=5,382.27..5,458.68 rows=8 width=74) (actual time=3.772..5.234 rows=39 loops=1)

8. 0.481 4.838 ↓ 1.6 39 1

Hash Join (cost=5,382.00..5,450.83 rows=25 width=51) (actual time=3.756..4.838 rows=39 loops=1)

  • Hash Cond: (ddu.domain_user_id = du.id)
9. 0.633 0.633 ↓ 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.016..0.633 rows=2,022 loops=1)

10. 0.942 3.724 ↑ 1.1 4,962 1

Hash (cost=5,315.58..5,315.58 rows=5,314 width=16) (actual time=3.724..3.724 rows=4,962 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 297kB
11. 2.263 2.782 ↑ 1.1 4,962 1

Bitmap Heap Scan on domain_user du (cost=114.01..5,315.58 rows=5,314 width=16) (actual time=0.598..2.782 rows=4,962 loops=1)

  • Recheck Cond: (user_id = 1251)
  • Filter: (NOT entity_deleted)
  • Rows Removed by Filter: 841
  • Heap Blocks: exact=596
12. 0.519 0.519 ↑ 1.0 5,803 1

Bitmap Index Scan on domain_user_user_id_idx (cost=0.00..112.68 rows=5,901 width=0) (actual time=0.519..0.519 rows=5,803 loops=1)

  • Index Cond: (user_id = 1251)
13. 0.312 0.312 ↑ 1.0 1 39

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

  • Index Cond: (id = du.role_group_id)
  • Filter: (client_id = 1005)
14. 0.156 0.156 ↑ 1.0 1 39

Index Scan using pk_entity_type on entity_type et (cost=0.14..0.33 rows=1 width=19) (actual time=0.003..0.004 rows=1 loops=39)

  • Index Cond: (id = rg.entity_type_id)
15. 0.195 0.195 ↑ 1.0 1 39

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

  • Index Cond: (id = ddu.delegated_user_id)
16. 0.234 0.234 ↑ 1.0 1 39

Index Scan using pk_app_user on app_user au2 (cost=0.28..0.73 rows=1 width=21) (actual time=0.005..0.006 rows=1 loops=39)

  • Index Cond: ((id = du.user_id) AND (id = 1251))
Planning time : 2.909 ms
Execution time : 58.984 ms