explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8evz

Settings
# exclusive inclusive rows x rows loops node
1. 1,374.237 7,936.011 ↑ 14.2 283,434 1

Hash Join (cost=561,781.18..6,100,269.51 rows=4,037,105 width=234) (actual time=7,077.718..7,936.011 rows=283,434 loops=1)

  • Hash Cond: (txheaders.tx_id = txdetails.tx_id)
2. 286.680 5,378.826 ↓ 3.0 4,295,139 1

Append (cost=0.57..5,349,870.28 rows=1,429,844 width=77) (actual time=0.031..5,378.826 rows=4,295,139 loops=1)

3. 5,092.146 5,092.146 ↓ 3.0 4,295,139 1

Index Scan using transactionheaders_p0_pkey on transactionheaders_p0 txheaders (cost=0.57..5,342,721.06 rows=1,429,844 width=77) (actual time=0.030..5,092.146 rows=4,295,139 loops=1)

  • Index Cond: (company_id = 79451168.000000000)
  • Filter: (tx_type_id = ANY ('{7,4,32}'::numeric[]))
  • Rows Removed by Filter: 753682
4. 159.394 1,182.948 ↓ 1.8 572,768 1

Hash (cost=553,579.94..553,579.94 rows=313,333 width=81) (actual time=1,182.948..1,182.948 rows=572,768 loops=1)

  • Buckets: 32768 Batches: 16 Memory Usage: 3517kB
5. 1,023.554 1,023.554 ↓ 1.8 572,768 1

Append (cost=0.70..553,579.94 rows=313,333 width=81) (actual time=0.037..1,023.554 rows=572,768 loops=1)

  • -> Index Scan using txdetails_p0_company_id_date_tx_date_is_no_post_tx_id_seque_idx on txdetails_p0 txdetails (cost=0.70..552013.28 rows=313333 width=81) (actual time=0.037..985.095 rows=5727
  • Index Cond: ((company_id = 79451168.000000000) AND (tx_date >= '2019-08-01'::date) AND (tx_date < '2019-12-31'::date) AND (is_no_post IS NULL))
  • Filter: (((tx_type_id = '8'::numeric) AND (sequence >= '0'::numeric)) OR ((tx_type_id <> '8'::numeric) AND (sequence > '0'::numeric)))
  • Rows Removed by Filter: 346447
Planning time : 18.774 ms
Execution time : 7,947.379 ms