explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BgYF

Settings
# exclusive inclusive rows x rows loops node
1. 727.178 58,791.261 ↑ 4.1 41,223 1

GroupAggregate (cost=11,187,251.65..11,257,313.93 rows=167,456 width=15) (actual time=53,208.034..58,791.261 rows=41,223 loops=1)

  • Group Key: pr.store_id, ((pr.status = 'package_validation_complete'::pkg.pkg_status)), plr.line_type, ((plr.exception IS TRUE)), ((plr.overage IS TRUE)), ((plr.shortage IS TRUE))
2. 39,791.011 58,064.083 ↑ 1.6 2,161,511 1

Sort (cost=11,187,251.65..11,195,747.78 rows=3,398,454 width=15) (actual time=53,207.909..58,064.083 rows=2,161,511 loops=1)

  • Sort Key: pr.store_id, ((pr.status = 'package_validation_complete'::pkg.pkg_status)), plr.line_type, ((plr.exception IS TRUE)), ((plr.overage IS TRUE)), ((plr.shortage IS TRUE))
  • Sort Method: external merge Disk: 52664kB
3. 4,196.443 18,273.072 ↑ 1.6 2,161,511 1

Nested Loop Left Join (cost=0.86..10,702,414.76 rows=3,398,454 width=15) (actual time=0.046..18,273.072 rows=2,161,511 loops=1)

4. 1,107.563 1,107.563 ↑ 1.0 2,161,511 1

Seq Scan on pkg_line_report plr (cost=0.00..69,325.44 rows=2,162,144 width=23) (actual time=0.007..1,107.563 rows=2,161,511 loops=1)

5. 2,161.511 12,969.066 ↑ 2.0 1 2,161,511

Bitmap Heap Scan on pkg_report pr (cost=0.86..4.89 rows=2 width=24) (actual time=0.005..0.006 rows=1 loops=2,161,511)

  • Recheck Cond: ((plr.pkg_hnid = pkg_hnid) OR (plr.sto_hnid = sto_hnid))
  • Heap Blocks: exact=2161511
6. 2,161.511 10,807.555 ↓ 0.0 0 2,161,511

BitmapOr (cost=0.86..0.86 rows=2 width=0) (actual time=0.005..0.005 rows=0 loops=2,161,511)

7. 4,323.022 4,323.022 ↑ 1.0 1 2,161,511

Bitmap Index Scan on pkg_report_pkg_hnid_key (cost=0.00..0.43 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=2,161,511)

  • Index Cond: (plr.pkg_hnid = pkg_hnid)
8. 4,323.022 4,323.022 ↑ 1.0 1 2,161,511

Bitmap Index Scan on pkg_report_sto_hnid_key (cost=0.00..0.43 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=2,161,511)

  • Index Cond: (plr.sto_hnid = sto_hnid)
Planning time : 1.715 ms
Execution time : 58,805.533 ms