explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kHks : Payment Tasks - Eligible for Invoicing - Part 2-1

Settings
# exclusive inclusive rows x rows loops node
1. 9.377 7,550.565 ↑ 2.4 299 1

GroupAggregate (cost=24,487.35..24,513.9 rows=710 width=33) (actual time=7,489.946..7,550.565 rows=299 loops=1)

  • Group Key: ecgps_core_study.id
2. 39.199 7,541.188 ↓ 80.6 64,072 1

Merge Join (cost=24,487.35..24,502.83 rows=795 width=33) (actual time=7,489.911..7,541.188 rows=64,072 loops=1)

3. 1.108 1.469 ↑ 1.0 710 1

Sort (cost=121.72..123.5 rows=710 width=33) (actual time=1.342..1.469 rows=710 loops=1)

  • Sort Key: ecgps_core_study.id
  • Sort Method: quicksort Memory: 80kB
4. 0.361 0.361 ↑ 1.0 710 1

Seq Scan on ecgps_core_study ecgps_core_study (cost=0..88.1 rows=710 width=33) (actual time=0.008..0.361 rows=710 loops=1)

5. 381.606 7,500.520 ↓ 80.6 64,072 1

Sort (cost=24,365.63..24,367.61 rows=795 width=33) (actual time=7,488.561..7,500.52 rows=64,072 loops=1)

  • Sort Key: ecgps_core_payment.study_id
  • Sort Method: external sort Disk: 2,944kB
6. 35.031 7,118.914 ↓ 80.6 64,072 1

Nested Loop (cost=463.51..24,327.33 rows=795 width=33) (actual time=59.577..7,118.914 rows=64,072 loops=1)

7. 36.550 81.951 ↓ 54.6 30,982 1

HashAggregate (cost=462.96..468.63 rows=567 width=33) (actual time=58.893..81.951 rows=30,982 loops=1)

  • Group Key: (v0.id)::text
8. 5.273 45.401 ↓ 54.6 30,982 1

Nested Loop (cost=5.52..461.54 rows=567 width=33) (actual time=0.262..45.401 rows=30,982 loops=1)

9. 0.678 6.758 ↓ 54.6 710 1

Nested Loop (cost=5.1..150.48 rows=13 width=66) (actual time=0.238..6.758 rows=710 loops=1)

10. 0.485 4.660 ↓ 54.6 710 1

Nested Loop (cost=4.83..142.86 rows=13 width=33) (actual time=0.222..4.66 rows=710 loops=1)

11. 1.165 1.335 ↓ 54.6 710 1

Bitmap Heap Scan on ecgps_core_userprofilestudy u0 (cost=4.55..54.89 rows=13 width=33) (actual time=0.205..1.335 rows=710 loops=1)

  • Heap Blocks: exact=233
12. 0.170 0.170 ↓ 54.6 710 1

Bitmap Index Scan on idx_userprofilestudy_profileid_sponsorportalaccess (cost=0..4.55 rows=13 width=0) (actual time=0.17..0.17 rows=710 loops=1)

  • Index Cond: (((profile_id)::text = '3ef4d33492f3489985aaba7eeb5e3918'::text) AND ((sponsor_portal_access)::text = 'active'::text))
13. 2.840 2.840 ↑ 1.0 1 710

Index Scan using ecgps_core_study_pkey on ecgps_core_study v2 (cost=0.28..6.76 rows=1 width=66) (actual time=0.004..0.004 rows=1 loops=710)

  • Index Cond: ((id)::text = (u0.study_id)::text)
14. 1.420 1.420 ↑ 1.0 1 710

Index Only Scan using ecgps_core_event_id_391e7f0ea35b6e5f_like on ecgps_core_event v1 (cost=0.28..0.58 rows=1 width=33) (actual time=0.002..0.002 rows=1 loops=710)

  • Index Cond: (id = (v2.event_id)::text)
  • Heap Fetches: 710
15. 33.370 33.370 ↑ 1.1 44 710

Index Scan using ecgps_core_payeeevent_4437cfac on ecgps_core_payeeevent v0 (cost=0.41..23.44 rows=49 width=66) (actual time=0.008..0.047 rows=44 loops=710)

  • Index Cond: ((event_id)::text = (v1.id)::text)
16. 7,001.932 7,001.932 ↓ 2.0 2 30,982

Index Scan using ecgps_core_payment_payee_event_id_2d2107bc8b3e0bcd_like on ecgps_core_payment ecgps_core_payment (cost=0.56..42.07 rows=1 width=66) (actual time=0.213..0.226 rows=2 loops=30,982)

  • Index Cond: ((payee_event_id)::text = (v0.id)::text)
  • Filter: ((payment_list_eligible_date IS NOT NULL) AND (NOT is_historic) AND (NOT is_reversal) AND ((status)::text = 'approved'::text) AND ((invoice_number)::text = ''::text))
Planning time : 3.036 ms
Execution time : 7,551.199 ms