explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wh4AE

Settings
# exclusive inclusive rows x rows loops node
1. 18,174.104 360,481.341 ↓ 28.9 778,261 1

Unique (cost=726,770.85..726,972.63 rows=26,904 width=8) (actual time=249,052.615..360,481.341 rows=778,261 loops=1)

2. 182,134.061 342,307.237 ↓ 3,605.3 96,998,127 1

Sort (cost=726,770.85..726,838.11 rows=26,904 width=8) (actual time=249,052.614..342,307.237 rows=96,998,127 loops=1)

  • Sort Key: po_revision_branch_assoc.id_instan_branch, mv_scr_activity_stats.id_employee
  • Sort Method: external merge Disk: 1,705,928kB
3. 16,595.016 160,173.176 ↓ 3,605.3 96,998,127 1

Nested Loop (cost=1,133.26..724,791.32 rows=26,904 width=8) (actual time=145.745..160,173.176 rows=96,998,127 loops=1)

4. 2,675.443 2,722.124 ↓ 1.0 47,764 1

Bitmap Heap Scan on mv_scr_activity_stats (cost=1,133.26..158,093.82 rows=45,526 width=51) (actual time=69.738..2,722.124 rows=47,764 loops=1)

  • Recheck Cond: (id_project_sub = 81,873)
  • Heap Blocks: exact=7,577
5. 46.681 46.681 ↓ 1.0 47,764 1

Bitmap Index Scan on idx_mv_scr_activity_stats_id_project_sub (cost=0.00..1,121.88 rows=45,526 width=0) (actual time=46.681..46.681 rows=47,764 loops=1)

  • Index Cond: (id_project_sub = 81,873)
6. 10,890.192 140,856.036 ↓ 677.0 2,031 47,764

Append (cost=0.00..12.42 rows=3 width=50) (actual time=0.432..2.949 rows=2,031 loops=47,764)

7. 0.000 0.000 ↓ 0.0 0 47,764

Seq Scan on po_revision_branch_assoc (cost=0.00..0.00 rows=1 width=40) (actual time=0.000..0.000 rows=0 loops=47,764)

  • Filter: (bl_is_optimized AND (id_enterprise = 121) AND (mv_scr_activity_stats.id_infra_instan = id_infra_instan) AND (mv_scr_activity_stats.tx_revision = (tx_revision)::text))
8. 129,965.844 129,965.844 ↓ 1,015.5 2,031 47,764

Index Scan using idx_po_revision_branch_assoc_121_infra_revision on po_revision_branch_assoc_121 (cost=0.69..12.42 rows=2 width=50) (actual time=0.429..2.721 rows=2,031 loops=47,764)

  • Index Cond: ((id_infra_instan = mv_scr_activity_stats.id_infra_instan) AND ((tx_revision)::text = mv_scr_activity_stats.tx_revision) AND (bl_is_optimized = true))
  • Filter: (bl_is_optimized AND (id_enterprise = 121))
Planning time : 3,391.019 ms
Execution time : 361,121.939 ms