explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FF1y

Settings
# exclusive inclusive rows x rows loops node
1. 289.740 29,909.358 ↑ 42.1 476,504 1

Aggregate (cost=13,273,558.62..16,591,940.65 rows=20,084,538 width=49) (actual time=26,157.193..29,909.358 rows=476,504 loops=1)

  • Buffers: shared hit=3980516 dirtied=28, temp read=11716 written=11717
2. 0.000 29,619.618 ↑ 9.3 2,159,479 1

Gather Merge (cost=13,273,558.62..15,838,770.53 rows=20,084,535 width=73) (actual time=26,157.111..29,619.618 rows=2,159,479 loops=1)

  • Buffers: shared hit=40608732 dirtied=211, temp read=119416 written=119426
3. 5,250.600 269,738.170 ↑ 10.3 215,948 10

Aggregate (cost=13,272,558.46..13,345,085.95 rows=2,231,615 width=73) (actual time=25,930.707..26,973.817 rows=215,948 loops=10)

  • Buffers: shared hit=40608732 dirtied=211, temp read=119416 written=119426
4. 66,141.120 264,487.570 ↑ 1.2 1,864,299 10

Sort (cost=13,272,558.46..13,278,137.5 rows=2,231,615 width=41) (actual time=25,930.652..26,448.757 rows=1,864,299 loops=10)

  • Sort Key: t.trn_num_payments, p.pro_name, t.trn_psp_merchant_id, (date_trunc('day'::text, t.trn_created_at))
  • Sort Method: external merge Disk: 93728kB
  • Buffers: shared hit=40608732 dirtied=211, temp read=119416 written=119426
5. 9,533.800 198,346.450 ↑ 1.2 1,864,299 10

Hash Join (cost=4.42..12,997,029.79 rows=2,231,615 width=41) (actual time=0.308..19,834.645 rows=1,864,299 loops=10)

  • Buffers: shared hit=40608534 dirtied=211
6. 188,811.950 188,811.950 ↑ 1.2 1,864,299 10

Index Scan using idx_trn_date_status_product on sw_transactions t (cost=0.57..12,985,286.15 rows=2,231,615 width=35) (actual time=0.152..18,881.195 rows=1,864,299 loops=10)

  • Index Cond: ((t.trn_created_at >= '2019-01-01 00:00:00-03'::timestamp with time zone) AND ((t.trn_psp_response_cod)::text = '0'::text))
  • Filter: ((t.trn_operation_id = ANY ('{61,57}'::integer[])) AND (t.trn_country = 'ARG'::bpchar))
  • Buffers: shared hit=40608415 dirtied=211
7. 0.250 0.700 ↑ 1.0 82 10

Hash (cost=2.82..2.82 rows=82 width=14) (actual time=0.069..0.07 rows=82 loops=10)

  • Buffers: shared hit=20
8. 0.450 0.450 ↑ 1.0 82 10

Seq Scan on sw_products p (cost=0..2.82 rows=82 width=14) (actual time=0.022..0.045 rows=82 loops=10)

  • Buffers: shared hit=20