explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jM6G : Optimization for: plan #fjOh

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.008 2,396.238 ↑ 1.0 1 1

Aggregate (cost=20,618.24..20,618.25 rows=1 width=0) (actual time=2,396.238..2,396.238 rows=1 loops=1)

2. 0.858 2,396.230 ↑ 1.0 1 1

Nested Loop (cost=0.84..20,618.24 rows=1 width=0) (actual time=144.461..2,396.230 rows=1 loops=1)

3. 5.078 5.078 ↓ 1.5 586 1

Index Scan using index_customers_on_user_id on customers (cost=0.41..2,305.71 rows=399 width=4) (actual time=0.023..5.078 rows=586 loops=1)

  • Index Cond: (user_id = 23794)
  • Filter: ((status = ANY ('{10,3,6,38}'::integer[])) OR ((status = 2) AND ((((bank_details -> 'axis'::text) ->> 'bank_status'::text) <> ALL ('{Disbursed,"Closed WIP",Cancelled,Dispute}'::text[])) OR (((bank_details -> 'sbi'::text) ->> 'bank_sta (...)
  • Rows Removed by Filter: 964
4. 2,390.294 2,390.294 ↓ 0.0 0 586

Index Scan using index_customer_interactions_on_customer_id on customer_interactions (cost=0.42..45.89 rows=1 width=4) (actual time=4.079..4.079 rows=0 loops=586)

  • Index Cond: (customer_id = customers.id)
  • Filter: ((interaction_type = 1) AND ((interaction_attributes ->> 'received'::text) = 'true'::text) AND ((interaction_attributes ->> 'read'::text) = 'false'::text))
  • Rows Removed by Filter: 24
Planning time : 2.541 ms