explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zx7S

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=1,781,572.19..1,781,801.56 rows=500 width=520) (actual rows= loops=)

2.          

CTE servicer_loan

3. 0.000 0.000 ↓ 0.0

Gather Merge (cost=427,437.95..454,097.45 rows=228,494 width=622) (actual rows= loops=)

  • Workers Planned: 2
4. 0.000 0.000 ↓ 0.0

Sort (cost=426,437.93..426,723.55 rows=114,247 width=622) (actual rows= loops=)

  • Sort Key: servicer_records.record_date DESC
5. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on servicer_records (cost=5,817.42..353,574.15 rows=114,247 width=622) (actual rows= loops=)

  • Recheck Cond: ((source_file)::text = 'loan'::text)
6. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_servicer_records_on_source_file (cost=0.00..5,748.87 rows=274,192 width=0) (actual rows= loops=)

  • Index Cond: ((source_file)::text = 'loan'::text)
7.          

CTE servicer_loan2

8. 0.000 0.000 ↓ 0.0

Gather Merge (cost=421,632.76..447,405.76 rows=220,896 width=622) (actual rows= loops=)

  • Workers Planned: 2
9. 0.000 0.000 ↓ 0.0

Sort (cost=420,632.73..420,908.85 rows=110,448 width=622) (actual rows= loops=)

  • Sort Key: servicer_records_1.record_date DESC
10. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on servicer_records servicer_records_1 (cost=5,622.77..350,222.05 rows=110,448 width=622) (actual rows= loops=)

  • Recheck Cond: ((source_file)::text = 'loan2'::text)
11. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_servicer_records_on_source_file (cost=0.00..5,556.50 rows=265,076 width=0) (actual rows= loops=)

  • Index Cond: ((source_file)::text = 'loan2'::text)
12.          

CTE servicer_fee

13. 0.000 0.000 ↓ 0.0

Gather Merge (cost=443,105.65..472,368.63 rows=250,808 width=622) (actual rows= loops=)

  • Workers Planned: 2
14. 0.000 0.000 ↓ 0.0

Sort (cost=442,105.62..442,419.13 rows=125,404 width=622) (actual rows= loops=)

  • Sort Key: servicer_records_2.record_date DESC
15. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on servicer_records servicer_records_2 (cost=6,384.95..362,046.27 rows=125,404 width=622) (actual rows= loops=)

  • Recheck Cond: ((source_file)::text = 'fee'::text)
16. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_servicer_records_on_source_file (cost=0.00..6,309.71 rows=300,970 width=0) (actual rows= loops=)

  • Index Cond: ((source_file)::text = 'fee'::text)
17.          

CTE servicer_loan_payments

18. 0.000 0.000 ↓ 0.0

Gather Merge (cost=26,476.13..27,165.68 rows=5,910 width=622) (actual rows= loops=)

  • Workers Planned: 2
19. 0.000 0.000 ↓ 0.0

Sort (cost=25,476.11..25,483.49 rows=2,955 width=622) (actual rows= loops=)

  • Sort Key: servicer_records_3.record_date DESC
20. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on servicer_records servicer_records_3 (cost=151.40..25,305.77 rows=2,955 width=622) (actual rows= loops=)

  • Recheck Cond: ((source_file)::text = 'loan_payments'::text)
21. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_servicer_records_on_source_file (cost=0.00..149.63 rows=7,093 width=0) (actual rows= loops=)

  • Index Cond: ((source_file)::text = 'loan_payments'::text)
22.          

CTE servicer_loan_payments_mtd

23. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on servicer_records servicer_records_4 (cost=1,783.73..199,187.14 rows=84,038 width=622) (actual rows= loops=)

  • Recheck Cond: ((source_file)::text = 'loan_payments_mtd'::text)
24. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_servicer_records_on_source_file (cost=0.00..1,762.72 rows=84,038 width=0) (actual rows= loops=)

  • Index Cond: ((source_file)::text = 'loan_payments_mtd'::text)
25.          

Initplan (forLimit)

26. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.03 rows=1 width=8) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.03 rows=1 width=8) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.03 rows=1 width=8) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.03 rows=1 width=8) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=181,347.44..267,218.10 rows=187,184 width=520) (actual rows= loops=)