explain.depesz.com

PostgreSQL's explain analyze made readable

Result: r6n6 : Optimization for: Optimization for: Optimization for: plan #2QsO; plan #cZdH; plan #Ee2f

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.017 87,404.220 ↓ 8.6 43 1

Limit (cost=201,023.20..201,023.21 rows=5 width=340) (actual time=87,404.193..87,404.220 rows=43 loops=1)

2. 0.222 87,404.203 ↓ 8.6 43 1

Sort (cost=201,023.20..201,023.21 rows=5 width=340) (actual time=87,404.192..87,404.203 rows=43 loops=1)

  • Sort Key: receipts.contribution_amount DESC
  • Sort Method: quicksort Memory: 47kB
3. 1,799.958 87,403.981 ↓ 8.6 43 1

Nested Loop Semi Join (cost=202.19..201,023.14 rows=5 width=340) (actual time=1,275.432..87,403.981 rows=43 loops=1)

4. 1,086.592 16,261.768 ↓ 1,673.1 1,540,939 1

Nested Loop (cost=200.89..187,786.03 rows=921 width=340) (actual time=24.701..16,261.768 rows=1,540,939 loops=1)

5. 0.030 0.030 ↑ 2.0 3 1

Index Scan using ix_committees_super_committee_id on committees (cost=0.42..9.51 rows=6 width=4) (actual time=0.025..0.030 rows=3 loops=1)

  • Index Cond: (super_committee_id = 47823)
6. 12,502.911 15,175.146 ↓ 62.3 513,646 3

Bitmap Heap Scan on receipts (cost=200.47..31,213.63 rows=8,246 width=340) (actual time=894.984..5,058.382 rows=513,646 loops=3)

  • Recheck Cond: (recipient_committee_id = committees.id)
  • Heap Blocks: exact=73900
7. 2,672.235 2,672.235 ↓ 62.3 513,646 3

Bitmap Index Scan on ix_receipts_recipient_committee_id (cost=0.00..198.41 rows=8,246 width=0) (actual time=890.745..890.745 rows=513,646 loops=3)

  • Index Cond: (recipient_committee_id = committees.id)
8. 805.035 69,342.255 ↓ 0.0 0 1,540,939

Nested Loop (cost=1.30..14.36 rows=1 width=8) (actual time=0.045..0.045 rows=0 loops=1,540,939)

9. 3,085.464 26,195.963 ↑ 1.0 1 1,540,939

Nested Loop (cost=0.86..9.13 rows=1 width=12) (actual time=0.016..0.017 rows=1 loops=1,540,939)

10. 6,163.756 6,163.756 ↑ 1.0 1 1,540,939

Index Only Scan using individuals_pkey on individuals (cost=0.43..3.89 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1,540,939)

  • Index Cond: (id = receipts.donor_individual_id)
  • Heap Fetches: 525786
11. 16,946.743 16,946.743 ↑ 1.0 1 1,540,613

Index Scan using ix_individual_matches_individual_id on individual_matches (cost=0.43..5.24 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=1,540,613)

  • Index Cond: (individual_id = individuals.id)
12. 42,341.257 42,341.257 ↓ 0.0 0 1,365,847

Index Scan using super_individuals_pkey on super_individuals (cost=0.43..5.22 rows=1 width=4) (actual time=0.031..0.031 rows=0 loops=1,365,847)

  • Index Cond: (id = individual_matches.super_individual_id)
  • Filter: ((employer_tsvector @@ '''facebook'':*'::tsquery) OR (employer_tsvector @@ '''google'':*'::tsquery))
  • Rows Removed by Filter: 1
Planning time : 19.391 ms
Execution time : 87,404.303 ms