explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7qxe

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 5,400.454 ↓ 0.0 0 1

Limit (cost=1,839,736.64..1,839,736.64 rows=3 width=37) (actual time=5,400.454..5,400.454 rows=0 loops=1)

2. 0.004 5,400.453 ↓ 0.0 0 1

Sort (cost=1,839,736.64..1,839,740.18 rows=1,416 width=37) (actual time=5,400.452..5,400.453 rows=0 loops=1)

  • Sort Key: (sum(c.home_amount))
  • Sort Method: quicksort Memory: 25kB
3. 0.000 5,400.449 ↓ 0.0 0 1

Finalize GroupAggregate (cost=1,839,543.78..1,839,718.34 rows=1,416 width=37) (actual time=5,400.448..5,400.449 rows=0 loops=1)

  • Group Key: t.item_id
4. 9.820 5,404.366 ↓ 0.0 0 1

Gather Merge (cost=1,839,543.78..1,839,691.79 rows=1,180 width=37) (actual time=5,400.447..5,404.366 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 0.001 5,394.546 ↓ 0.0 0 3 / 3

Partial GroupAggregate (cost=1,838,543.76..1,838,555.56 rows=590 width=37) (actual time=5,394.546..5,394.546 rows=0 loops=3)

  • Group Key: t.item_id
6. 0.019 5,394.545 ↓ 0.0 0 3 / 3

Sort (cost=1,838,543.76..1,838,545.24 rows=590 width=11) (actual time=5,394.544..5,394.545 rows=0 loops=3)

  • Sort Key: t.item_id
  • Sort Method: quicksort Memory: 25kB
  • Worker 0: Sort Method: quicksort Memory: 25kB
  • Worker 1: Sort Method: quicksort Memory: 25kB
7. 0.001 5,394.526 ↓ 0.0 0 3 / 3

Hash Join (cost=347.43..1,838,516.61 rows=590 width=11) (actual time=5,394.526..5,394.526 rows=0 loops=3)

  • Hash Cond: (c.account_id = a.account_id)
8. 44.633 5,394.525 ↓ 0.0 0 3 / 3

Nested Loop (cost=1.40..1,838,157.76 rows=4,823 width=24) (actual time=5,394.525..5,394.525 rows=0 loops=3)

9. 39.294 575.780 ↓ 1.4 596,764 3 / 3

Parallel Append (cost=0.70..664,418.33 rows=416,645 width=23) (actual time=0.042..575.780 rows=596,764 loops=3)

10. 536.486 536.486 ↓ 1.4 596,764 3 / 3

Parallel Index Only Scan using txdetails_p1_company_id_date_tx_date_is_no_post_tx_id_seque_idx on txdetails_p1 t (cost=0.70..662,335.11 rows=416,645 width=23) (actual time=0.042..536.486 rows=596,764 loops=3)

  • Index Cond: ((company_id = '109287618'::numeric) AND (is_no_post IS NULL) AND (item_id IS NOT NULL))
  • Heap Fetches: 18
11. 596.764 4,774.112 ↓ 0.0 0 1,790,292 / 3

Append (cost=0.70..2.81 rows=1 width=29) (actual time=0.008..0.008 rows=0 loops=1,790,292)

12. 4,177.348 4,177.348 ↓ 0.0 0 1,790,292 / 3

Index Scan using cashbasis_p1_pkey on cashbasis_p1 c (cost=0.70..2.80 rows=1 width=29) (actual time=0.007..0.007 rows=0 loops=1,790,292)

  • Index Cond: ((company_id = '109287618'::numeric) AND (tx_id = t.tx_id) AND (sequence = t.sequence))
  • Filter: ((cash_date >= '2020-01-01 00:00:00'::timestamp without time zone) AND (cash_date <= '2020-01-29 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 1
13. 0.000 0.000 ↓ 0.0 0 / 3

Hash (cost=345.48..345.48 rows=44 width=13) (never executed)

14. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using accounts_pk on accounts a (cost=0.56..345.48 rows=44 width=13) (never executed)

  • Index Cond: (company_id = '109287618'::numeric)
  • Filter: (account_type_id = '10'::numeric)
Planning time : 1.439 ms
Execution time : 5,404.471 ms