explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iP8Iy : Payment Tasks - Eligible for Invoicing - Part 1

Settings
# exclusive inclusive rows x rows loops node
1. 10.121 27,321.069 ↑ 4.0 162 1

HashAggregate (cost=108,384.55..108,390.98 rows=643 width=33) (actual time=27,321.047..27,321.069 rows=162 loops=1)

  • Group Key: ecgps_core_study.id
2. 15.029 27,310.948 ↓ 28.8 18,520 1

Nested Loop (cost=1,231.18..108,381.33 rows=643 width=33) (actual time=18.387..27,310.948 rows=18,520 loops=1)

3. 655.930 27,240.359 ↓ 28.8 18,520 1

Hash Join (cost=1,230.76..105,399.4 rows=643 width=66) (actual time=18.371..27,240.359 rows=18,520 loops=1)

4. 1,206.489 26,580.424 ↓ 26.3 2,904,911 1

Nested Loop (cost=150.42..103,898.88 rows=110,331 width=66) (actual time=1.245..26,580.424 rows=2,904,911 loops=1)

5. 847.900 7,879.789 ↓ 26.0 2,915,691 1

Nested Loop (cost=149.87..21,739.84 rows=112,332 width=66) (actual time=1.208..7,879.789 rows=2,915,691 loops=1)

6. 0.922 21.349 ↓ 54.6 710 1

Nested Loop (cost=0.97..176.39 rows=13 width=66) (actual time=0.077..21.349 rows=710 loops=1)

7. 1.402 14.037 ↓ 54.6 710 1

Nested Loop (cost=0.7..168.76 rows=13 width=99) (actual time=0.068..14.037 rows=710 loops=1)

8. 4.115 4.115 ↓ 54.6 710 1

Index Scan using ecgps_core_userprofilestudy_profile_id_197f15c8194ec51d_uniq on ecgps_core_userprofilestudy u0 (cost=0.42..80.8 rows=13 width=33) (actual time=0.057..4.115 rows=710 loops=1)

  • Index Cond: ((profile_id)::text = '3ef4d33492f3489985aaba7eeb5e3918'::text)
  • Filter: ((sponsor_portal_access)::text = 'active'::text)
9. 8.520 8.520 ↑ 1.0 1 710

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

  • Index Cond: ((id)::text = (u0.study_id)::text)
10. 6.390 6.390 ↑ 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.008..0.009 rows=1 loops=710)

  • Index Cond: (id = (ecgps_core_study.event_id)::text)
  • Heap Fetches: 710
11. 6,391.420 7,010.540 ↑ 1.4 4,107 710

Bitmap Heap Scan on ecgps_core_payment ecgps_core_payment (cost=148.9..1,584.46 rows=5,941 width=66) (actual time=1.257..9.874 rows=4,107 loops=710)

  • Filter: ((status)::text <> 'declined'::text)
  • Heap Blocks: exact=1,158,917 lossy=105,642
12. 619.120 619.120 ↑ 1.4 4,166 710

Bitmap Index Scan on ecgps_core_payment_study_id_like (cost=0..147.41 rows=6,036 width=0) (actual time=0.872..0.872 rows=4,166 loops=710)

  • Index Cond: ((study_id)::text = (ecgps_core_study.id)::text)
13. 17,494.146 17,494.146 ↑ 1.0 1 2,915,691

Index Scan using ecgps_core_invoicepaymentrecord_payment_record_id_like on ecgps_core_invoicepaymentrecord ecgps_core_invoicepaymentrecord (cost=0.56..0.72 rows=1 width=66) (actual time=0.006..0.006 rows=1 loops=2,915,691)

  • Index Cond: ((payment_record_id)::text = (ecgps_core_payment.id)::text)
14. 0.298 4.005 ↑ 1.1 1,124 1

Hash (cost=1,065.21..1,065.21 rows=1,210 width=66) (actual time=4.005..4.005 rows=1,124 loops=1)

15. 3.707 3.707 ↑ 1.1 1,124 1

Index Scan using idx_invoice_invoicestatus on ecgps_core_invoice ecgps_core_invoice (cost=0.42..1,065.21 rows=1,210 width=66) (actual time=0.026..3.707 rows=1,124 loops=1)

  • Index Cond: ((invoice_status)::text = 'declined'::text)
16. 55.560 55.560 ↑ 1.0 1 18,520

Index Only Scan using ecgps_core_payeeevent_id_50309a15dc81cefc_like on ecgps_core_payeeevent v0 (cost=0.41..4.63 rows=1 width=33) (actual time=0.003..0.003 rows=1 loops=18,520)

  • Index Cond: (id = (ecgps_core_invoice.payee_event_id)::text)
  • Heap Fetches: 18,520
Planning time : 4.037 ms
Execution time : 27,321.187 ms