explain.depesz.com

PostgreSQL's explain analyze made readable

Result: R63

Settings
# exclusive inclusive rows x rows loops node
1. 489.494 7,927.818 ↓ 10.8 146,310 1

Nested Loop (cost=18,080.05..409,445.40 rows=13,514 width=8,977) (actual time=115.623..7,927.818 rows=146,310 loops=1)

2. 444.933 6,352.169 ↓ 9.1 155,165 1

Hash Join (cost=18,079.62..399,661.44 rows=17,040 width=6,515) (actual time=115.603..6,352.169 rows=155,165 loops=1)

  • Hash Cond: (edu2cd.f_org = org.id)
3. 547.428 5,899.653 ↓ 2.8 174,650 1

Nested Loop (cost=17,246.96..398,428.11 rows=61,406 width=2,838) (actual time=108.000..5,899.653 rows=174,650 loops=1)

4. 589.580 4,469.373 ↓ 4.3 147,142 1

Nested Loop Semi Join (cost=17,246.53..364,463.98 rows=34,347 width=2,772) (actual time=107.973..4,469.373 rows=147,142 loops=1)

  • Join Filter: ((edu.f_enroll_date >= _y.begin) AND (edu.f_enroll_date <= _y."end"))
  • Rows Removed by Join Filter: 81692
5. 3,558.010 3,650.959 ↑ 1.4 228,834 1

Bitmap Heap Scan on mainchildeducation edu (cost=17,246.53..315,282.17 rows=309,122 width=2,772) (actual time=107.936..3,650.959 rows=228,834 loops=1)

  • Filter: (f_uptodate AND (NOT deleted) AND (f_get_learning_status_by_date(f_enroll_date, f_exclude_date, (now())::date) IS TRUE))
  • Rows Removed by Filter: 702776
  • Heap Blocks: exact=51769
6. 92.949 92.949 ↓ 1.0 931,610 1

Bitmap Index Scan on mainchildeducation_f_uptodate_idx (cost=0.00..17,169.25 rows=929,176 width=0) (actual time=92.949..92.949 rows=931,610 loops=1)

  • Index Cond: (f_uptodate = true)
7. 228.770 228.834 ↑ 10.0 1 228,834

Materialize (cost=0.00..3.33 rows=10 width=8) (actual time=0.001..0.001 rows=1 loops=228,834)

8. 0.064 0.064 ↑ 10.0 1 1

Seq Scan on years _y (cost=0.00..3.28 rows=10 width=8) (actual time=0.022..0.064 rows=1 loops=1)

  • Filter: ((now() >= begin) AND (now() <= "end"))
  • Rows Removed by Filter: 113
9. 882.852 882.852 ↑ 2.0 1 147,142

Index Scan using mainchildeducation2child_f_edu_oo_idx on mainchildeducation2child edu2cd (cost=0.43..0.97 rows=2 width=66) (actual time=0.005..0.006 rows=1 loops=147,142)

  • Index Cond: (f_edu_oo = edu.id)
10. 1.520 7.583 ↓ 1.0 1,097 1

Hash (cost=819.10..819.10 rows=1,085 width=3,677) (actual time=7.583..7.583 rows=1,097 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 1610kB
11. 6.063 6.063 ↓ 1.0 1,097 1

Seq Scan on organization org (cost=0.00..819.10 rows=1,085 width=3,677) (actual time=0.011..6.063 rows=1,097 loops=1)

  • Filter: (f_uptodate AND (NOT deleted))
  • Rows Removed by Filter: 2798
12. 1,086.155 1,086.155 ↑ 1.0 1 155,165

Index Scan using person_pkey on person pn (cost=0.42..0.56 rows=1 width=2,462) (actual time=0.006..0.007 rows=1 loops=155,165)

  • Index Cond: (id = edu2cd.f_child)
  • Filter: (f_uptodate AND (NOT deleted))
  • Rows Removed by Filter: 0
Planning time : 2.438 ms
Execution time : 8,022.476 ms