explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yec6

Settings
# exclusive inclusive rows x rows loops node
1. 99.017 7,524.689 ↑ 181.5 1,649 1

GroupAggregate (cost=96,515.04..105,493.14 rows=299,270 width=49) (actual time=7,370.268..7,524.689 rows=1,649 loops=1)

  • Group Key: accounts.account_id, accounts.account_type_id, (date_part('year'::text, (txdetails.tx_date)::timestamp without time zone))
2. 247.592 7,425.672 ↓ 1.3 385,285 1

Sort (cost=96,515.04..97,263.22 rows=299,270 width=23) (actual time=7,370.239..7,425.672 rows=385,285 loops=1)

  • Sort Key: accounts.account_id, accounts.account_type_id, (date_part('year'::text, (txdetails.tx_date)::timestamp without time zone))
  • Sort Method: external merge Disk: 14776kB
3. 106.042 7,178.080 ↓ 1.3 385,285 1

Nested Loop (cost=1.26..69,294.81 rows=299,270 width=23) (actual time=5.786..7,178.080 rows=385,285 loops=1)

4. 56.394 56.394 ↓ 2.1 444 1

Index Scan using accounts_pk on accounts (cost=0.56..235.19 rows=208 width=17) (actual time=1.424..56.394 rows=444 loops=1)

  • Index Cond: (company_id = '64413907'::numeric)
5. 41.292 7,015.644 ↓ 3.1 868 444

Append (cost=0.70..322.01 rows=281 width=23) (actual time=0.152..15.801 rows=868 loops=444)

6. 6,974.352 6,974.352 ↓ 3.1 868 444

Index Scan using txdetails_p5_accountdateamount2 on txdetails_p5 txdetails (cost=0.70..320.61 rows=281 width=23) (actual time=0.150..15.708 rows=868 loops=444)

  • Index Cond: ((company_id = '64413907'::numeric) AND (account_id = accounts.account_id) AND (account_id IS NOT NULL) AND (tx_date < '2019-12-31'::date) AND (is_no_post IS NULL))
Planning time : 23.219 ms
Execution time : 7,527.124 ms