explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XDaZ

Settings
# exclusive inclusive rows x rows loops node
1. 0.130 315.488 ↑ 1.0 1 1

Aggregate (cost=12,350.79..12,350.80 rows=1 width=8) (actual time=315.488..315.488 rows=1 loops=1)

2. 3.614 315.358 ↓ 17.8 409 1

Hash Join (cost=11,455.84..12,350.73 rows=23 width=8) (actual time=293.238..315.358 rows=409 loops=1)

  • Hash Cond: (approval_project_rules_1.id = approval_project_rules.id)
3. 87.747 306.849 ↓ 37.6 13,379 1

HashAggregate (cost=10,948.71..11,839.11 rows=356 width=8) (actual time=288.253..306.849 rows=13,379 loops=1)

  • Group Key: approval_project_rules_1.id
  • Filter: (count(approval_project_rules_users.*) = approval_project_rules_1.approvals_required)
  • Rows Removed by Filter: 34,808
4. 77.406 219.102 ↓ 1.8 137,889 1

Hash Join (cost=5,170.75..10,560.50 rows=77,642 width=54) (actual time=73.897..219.102 rows=137,889 loops=1)

  • Hash Cond: (approval_project_rules_users.approval_project_rule_id = approval_project_rules_1.id)
5. 68.677 68.677 ↓ 1.0 139,357 1

Seq Scan on approval_project_rules_users (cost=0.00..5,024.27 rows=139,227 width=52) (actual time=0.023..68.677 rows=139,357 loops=1)

6. 25.388 73.019 ↑ 1.0 71,232 1

Hash (cost=4,280.35..4,280.35 rows=71,232 width=10) (actual time=73.019..73.019 rows=71,232 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 3,946kB
7. 47.631 47.631 ↑ 1.0 71,232 1

Index Scan using index_approval_project_rules_on_rule_type on approval_project_rules approval_project_rules_1 (cost=0.42..4,280.35 rows=71,232 width=10) (actual time=0.029..47.631 rows=71,232 loops=1)

  • Index Cond: (rule_type = 0)
8. 1.936 4.895 ↑ 1.0 8,313 1

Hash (cost=402.54..402.54 rows=8,367 width=8) (actual time=4.895..4.895 rows=8,313 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 453kB
9. 2.959 2.959 ↑ 1.0 8,313 1

Index Only Scan using approval_project_rules_pkey on approval_project_rules (cost=0.42..402.54 rows=8,367 width=8) (actual time=0.019..2.959 rows=8,313 loops=1)

  • Index Cond: ((id >= 300,001) AND (id <= 400,000))
  • Heap Fetches: 1,292
Planning time : 0.839 ms
Execution time : 316.243 ms