explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ji5p : payments pending approval - optimized

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 5.981 41.585 ↑ 3.8 175 1

HashAggregate (cost=18,851.38..18,857.99 rows=661 width=112) (actual time=41.554..41.585 rows=175 loops=1)

  • Group Key: ecgps_core_payment.study_id, ecgps_core_study.study_name, ecgps_core_study.protocol, ecgps_core_study.slug
2. 4.888 35.604 ↓ 2.2 9,772 1

Hash Join (cost=1,688.14..18,795.87 rows=4,441 width=112) (actual time=1.65..35.604 rows=9,772 loops=1)

  • Filter: (((ecgps_core_paymentcreationtype.short_name)::text = 'standard'::text) OR (ecgps_core_payment.payment_creation_type_id IS NULL))
3. 5.542 30.712 ↓ 1.8 10,040 1

Hash Join (cost=1,687.09..18,742.69 rows=5,675 width=145) (actual time=1.635..30.712 rows=10,040 loops=1)

4. 23.589 23.589 ↓ 1.8 10,040 1

Index Scan using idx_payment_status_isautoapprove on ecgps_core_payment ecgps_core_payment (cost=0.43..16,993.35 rows=5,675 width=99) (actual time=0.048..23.589 rows=10,040 loops=1)

  • Index Cond: (((status)::text = 'pending'::text) AND (is_auto_approve = false))
  • Filter: (NOT is_auto_approve)
5. 0.254 1.581 ↓ 1.4 710 1

Hash (cost=1,680.19..1,680.19 rows=518 width=112) (actual time=1.581..1.581 rows=710 loops=1)

6. 0.347 1.327 ↓ 1.4 710 1

Hash Join (cost=118.7..1,680.19 rows=518 width=112) (actual time=0.72..1.327 rows=710 loops=1)

7. 0.302 0.517 ↓ 1.4 710 1

Bitmap Heap Scan on ecgps_core_userprofilestudy u0 (cost=21.73..1,576.09 rows=518 width=33) (actual time=0.248..0.517 rows=710 loops=1)

  • Heap Blocks: exact=233
8. 0.215 0.215 ↓ 1.4 710 1

Bitmap Index Scan on idx_userprofilestudy_profileid_sponsorportalaccess (cost=0..21.6 rows=518 width=0) (actual time=0.215..0.215 rows=710 loops=1)

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

Hash (cost=88.1..88.1 rows=710 width=79) (actual time=0.463..0.463 rows=710 loops=1)

10. 0.279 0.279 ↑ 1.0 710 1

Seq Scan on ecgps_core_study ecgps_core_study (cost=0..88.1 rows=710 width=79) (actual time=0.003..0.279 rows=710 loops=1)

11. 0.001 0.004 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=356) (actual time=0.004..0.004 rows=2 loops=1)

12. 0.003 0.003 ↑ 1.0 2 1

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

Planning time : 1.924 ms
Execution time : 41.694 ms