explain.depesz.com

PostgreSQL's explain analyze made readable

Result: f2WW

Settings
# exclusive inclusive rows x rows loops node
1. 0.207 59,597.258 ↑ 1.0 1 1

Aggregate (cost=154,930.91..154,930.92 rows=1 width=8) (actual time=59,597.258..59,597.258 rows=1 loops=1)

2. 14.325 59,597.051 ↓ 130.0 130 1

Nested Loop (cost=0.99..154,930.90 rows=1 width=8) (actual time=2,227.941..59,597.051 rows=130 loops=1)

3. 58,796.646 58,796.646 ↓ 11,560.0 11,560 1

Index Scan using idx_rrs_recip_id_date on recip_resp_stats recipientr0_ (cost=0.56..154,873.82 rows=1 width=8) (actual time=13.065..58,796.646 rows=11,560 loops=1)

  • Index Cond: ((evs_creation >= '2019-11-05 15:11:00+00'::timestamp with time zone) AND (evs_creation <= '2019-11-06 15:11:59.999+00'::timestamp with time zone) AND (is_latest = 'Y'::bpchar))
  • Filter: ((recipient_cat)::text = 'PERSON'::text)
  • Rows Removed by Filter: 4771
4. 59.030 786.080 ↓ 0.0 0 11,560

Index Scan using recipients_pk on recipients recipienti1_ (cost=0.43..57.07 rows=1 width=8) (actual time=0.068..0.068 rows=0 loops=11,560)

  • Index Cond: (recipient_id = recipientr0_.recip_id)
  • Filter: ((org_id = '200363'::bigint) AND ((SubPlan 1) OR (recipient_id = '5615025'::bigint) OR ((org_id = '200363'::bigint) AND (alternatives: SubPlan 2 or hashed SubPlan 3))))
  • Rows Removed by Filter: 1
5.          

SubPlan (for Index Scan)

6. 163.800 163.800 ↓ 2.0 2 130

Index Only Scan using person_sups_pk on person_sups supervisor3_ (cost=0.42..1.94 rows=1 width=8) (actual time=0.362..1.260 rows=2 loops=130)

  • Index Cond: (person_id = recipienti1_.recipient_id)
  • Heap Fetches: 38
7. 0.500 563.250 ↑ 1.0 1 125

Merge Join (cost=0.70..52.43 rows=1 width=0) (actual time=4.506..4.506 rows=1 loops=125)

  • Merge Cond: (administra4_.func_id = defaultadm5_.role_id)
8. 558.250 558.250 ↑ 1.0 1 125

Index Only Scan using persons_func_pk on persons_func administra4_ (cost=0.42..3.44 rows=1 width=8) (actual time=4.466..4.466 rows=1 loops=125)

  • Index Cond: (person_id = recipienti1_.recipient_id)
  • Heap Fetches: 125
9. 4.500 4.500 ↑ 1.3 26 125

Index Only Scan using role_pk on role defaultadm5_ (cost=0.28..48.90 rows=33 width=8) (actual time=0.007..0.036 rows=26 loops=125)

  • Index Cond: (role_id = ANY ('{1520280,1520281,1520282,1520283,1520284,1520285,1520286,1520287,1520288,1520289,1520292,1520293,1520294,1520295,1520296,1520297,1520298,1520299,1
  • Heap Fetches: 0
10. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=15.77..12,062.70 rows=1,805 width=8) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Index Only Scan using role_pk on role defaultadm5__1 (cost=0.28..48.90 rows=33 width=8) (never executed)

  • Index Cond: (role_id = ANY ('{1520280,1520281,1520282,1520283,1520284,1520285,1520286,1520287,1520288,1520289,1520292,1520293,1520294,1520295,1520296,1520297,1520298,1520299,1
  • Heap Fetches: 0
12. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on persons_func administra4__1 (cost=15.49..359.86 rows=419 width=16) (never executed)

  • Recheck Cond: (func_id = defaultadm5__1.role_id)
13. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_persons_func2 (cost=0.00..15.38 rows=419 width=0) (never executed)

  • Index Cond: (func_id = defaultadm5__1.role_id)
Planning time : 19.283 ms
Execution time : 59,597.606 ms