explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Q7A9

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.014 38.093 ↑ 1.0 25 1

Limit (cost=8,600.49..9,317.14 rows=25 width=1,697) (actual time=33.939..38.093 rows=25 loops=1)

2. 0.428 38.079 ↑ 27.1 325 1

Nested Loop (cost=0.71..252,920.19 rows=8,823 width=1,697) (actual time=0.060..38.079 rows=325 loops=1)

3. 37.326 37.326 ↑ 34.8 325 1

Index Scan Backward using idx_trn_date_status_product on sw_transactions s (cost=0.57..251,126.25 rows=11,304 width=1,619) (actual time=0.042..37.326 rows=325 loops=1)

  • Index Cond: ((trn_created_at >= '2019-09-14 00:00:00-03'::timestamp with time zone) AND (trn_created_at <= '2019-09-16 23:59:59-03'::timestamp with time zone) AND ((trn_psp_response_cod)::text = '0'::text))
  • Filter: ((trn_psp_merchant_id)::text = ANY ('{lan_aero2000,lan_arg_bbva,lan_arg_esp,lan_chile,lan_chile_bbva,lan_chile_esp,lan_ecuador,lan_ecuador_p,lan_ecu_esp,lan_peru,lan_peru_esp,lan_peru_p,lan_tours_esp,lan_tours,lan_tours_p,lan}'::text[]))
  • Rows Removed by Filter: 24698
4. 0.325 0.325 ↑ 1.0 1 325

Index Scan using idx_pro_type_productid on sw_products s2 (cost=0.14..0.16 rows=1 width=78) (actual time=0.001..0.001 rows=1 loops=325)

  • Index Cond: (((pro_type)::text = 'pan'::text) AND (sw_products_id = s.trn_product))