explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ChPj

Settings
# exclusive inclusive rows x rows loops node
1. 0.105 10,011.011 ↑ 1.0 1,000 1

Limit (cost=521,121.08..521,158.58 rows=1,000 width=349) (actual time=10,010.079..10,011.011 rows=1,000 loops=1)

2. 0.558 10,010.906 ↑ 570.5 1,000 1

Unique (cost=521,121.08..542,513.15 rows=570,455 width=349) (actual time=10,010.077..10,010.906 rows=1,000 loops=1)

3. 878.756 10,010.348 ↑ 570.5 1,000 1

Sort (cost=521,121.08..522,547.22 rows=570,455 width=349) (actual time=10,010.077..10,010.348 rows=1,000 loops=1)

  • Sort Key: trades.id, trades.trade_id, trades.created_at, trades.trade_type, trades.instrument_id, trades.trade_date, trades.settlement_date, trades.is_contractual, trades.schema_id, trades
  • Sort Method: external sort Disk: 190,400kB
4. 1,787.101 9,131.592 ↑ 1.0 569,280 1

Merge Join (cost=95,860.76..283,299.59 rows=570,455 width=349) (actual time=6,682.854..9,131.592 rows=569,280 loops=1)

  • Merge Cond: ((trades.trade_id)::text = (t.trade_id)::text)
5. 1,192.151 1,192.151 ↑ 1.2 1,707,817 1

Index Scan using trades_uq on trades (cost=0.43..174,023.22 rows=2,083,690 width=322) (actual time=4.372..1,192.151 rows=1,707,817 loops=1)

  • Filter: (account_id = 100,029)
  • Rows Removed by Filter: 9,907
6. 84.154 6,152.340 ↑ 1.0 570,051 1

Materialize (cost=95,859.30..98,722.93 rows=572,727 width=27) (actual time=5,502.803..6,152.340 rows=570,051 loops=1)

7. 5,866.286 6,068.186 ↑ 1.0 570,051 1

Sort (cost=95,859.30..97,291.11 rows=572,727 width=27) (actual time=5,502.800..6,068.186 rows=570,051 loops=1)

  • Sort Key: t.trade_id
  • Sort Method: external merge Disk: 20,736kB
8. 201.900 201.900 ↑ 1.0 570,051 1

Index Scan using trade_actions_idx on trade_actions t (cost=0.43..27,379.15 rows=572,727 width=27) (actual time=0.021..201.900 rows=570,051 loops=1)

  • Index Cond: (effective_date = '2020-09-18'::date)
Planning time : 0.508 ms
Execution time : 10,053.338 ms