explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bBys : Optimization for: Payments Declined; plan #kMuw

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 28.043 192.494 ↑ 12.6 435 1

HashAggregate (cost=4,821.74..4,876.48 rows=5,474 width=112) (actual time=192.405..192.494 rows=435 loops=1)

  • Group Key: ecgps_core_payment.study_id, ecgps_core_study.study_name, ecgps_core_study.protocol, ecgps_core_study.slug
2. 17.689 164.451 ↓ 3.5 41,835 1

Hash Join (cost=6.43..4,674.3 rows=11,795 width=112) (actual time=0.248..164.451 rows=41,835 loops=1)

  • Filter: (((ecgps_core_paymentcreationtype.short_name)::text = 'standard'::text) OR (ecgps_core_payment.payment_creation_type_id IS NULL))
3. 15.390 146.757 ↓ 2.8 41,929 1

Nested Loop (cost=5.38..4,530.91 rows=15,208 width=145) (actual time=0.238..146.757 rows=41,929 loops=1)

4. 0.667 10.667 ↓ 54.6 710 1

Nested Loop (cost=4.83..142.86 rows=13 width=112) (actual time=0.213..10.667 rows=710 loops=1)

5. 6.281 6.450 ↓ 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..6.45 rows=710 loops=1)

  • Heap Blocks: exact=233
6. 0.169 0.169 ↓ 54.6 710 1

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

  • Index Cond: (((profile_id)::text = '3ef4d33492f3489985aaba7eeb5e3918'::text) AND ((sponsor_portal_access)::text = 'active'::text))
7. 3.550 3.550 ↑ 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=79) (actual time=0.004..0.005 rows=1 loops=710)

  • Index Cond: ((id)::text = (u0.study_id)::text)
8. 120.700 120.700 ↑ 1.6 59 710

Index Scan using idx_payment_studyid_status on ecgps_core_payment ecgps_core_payment (cost=0.56..336.59 rows=95 width=99) (actual time=0.018..0.17 rows=59 loops=710)

  • Index Cond: (((study_id)::text = (ecgps_core_study.id)::text) AND ((status)::text = 'declined'::text))
9. 0.003 0.005 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=42) (actual time=0.005..0.005 rows=2 loops=1)

10. 0.002 0.002 ↑ 1.0 2 1

Seq Scan on ecgps_core_paymentcreationtype ecgps_core_paymentcreationtype (cost=0..1.02 rows=2 width=42) (actual time=0.001..0.002 rows=2 loops=1)

Planning time : 2.882 ms
Execution time : 192.602 ms