explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Si33

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 15,547.019 ↑ 1.4 742 1

Finalize GroupAggregate (cost=2,033,656.36..2,196,182.85 rows=1,029 width=4) (actual time=15,325.089..15,547.019 rows=742 loops=1)

  • Group Key: tb_asset_fund.id_manager
  • Filter: ((sum(CASE WHEN (tb_asset_operation.cd_operation_origin = ANY ('{API,AJU,BOL}'::bpchar[])) THEN 1 ELSE 0 END) > 0) AND (sum(CASE WHEN (tb_asset_operation.cd_operation_origin = ANY ('{CEI,VIR,CUS}'::bpchar[])) THEN 1 ELSE 0 END) = 0))
  • Rows Removed by Filter: 126682
2. 1,130.231 16,442.494 ↑ 3.4 366,227 1

Gather Merge (cost=2,033,656.36..2,177,668.32 rows=1,234,302 width=20) (actual time=15,325.055..16,442.494 rows=366,227 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 79.369 15,312.263 ↑ 5.1 122,076 3 / 3

Sort (cost=2,032,656.34..2,034,199.22 rows=617,151 width=20) (actual time=15,286.774..15,312.263 rows=122,076 loops=3)

  • Sort Key: tb_asset_fund.id_manager
  • Sort Method: quicksort Memory: 12700kB
  • Worker 0: Sort Method: quicksort Memory: 12554kB
  • Worker 1: Sort Method: quicksort Memory: 12575kB
4. 2,658.235 15,232.894 ↑ 5.1 122,076 3 / 3

Partial HashAggregate (cost=1,967,129.52..1,973,301.03 rows=617,151 width=20) (actual time=15,182.519..15,232.894 rows=122,076 loops=3)

  • Group Key: tb_asset_fund.id_manager
5. 2,159.233 12,574.659 ↓ 5.3 4,751,532 3 / 3

Parallel Hash Join (cost=120,415.99..1,953,567.01 rows=904,167 width=8) (actual time=1,177.210..12,574.659 rows=4,751,532 loops=3)

  • Hash Cond: (tb_asset_operation.id_fund = tb_asset_fund.id_fund)
6. 9,239.093 9,239.093 ↑ 1.3 6,714,018 3 / 3

Parallel Seq Scan on tb_asset_operation (cost=0.00..1,796,443.76 rows=8,783,974 width=12) (actual time=0.055..9,239.093 rows=6,714,018 loops=3)

  • Filter: ((id_asset = 97) AND (cd_operation_state = 'A'::bpchar))
  • Rows Removed by Filter: 11122700
7. 20.397 1,176.333 ↑ 1.4 43,076 3 / 3

Parallel Hash (cost=119,670.62..119,670.62 rows=59,629 width=20) (actual time=1,176.333..1,176.333 rows=43,076 loops=3)

  • Buckets: 262144 Batches: 1 Memory Usage: 9184kB
8. 103.735 1,155.936 ↑ 1.4 43,076 3 / 3

Parallel Hash Join (cost=65,900.82..119,670.62 rows=59,629 width=20) (actual time=727.175..1,155.936 rows=43,076 loops=3)

  • Hash Cond: (tb_as_portfolio.id_portfolio = tb_asset_fund.id_portfolio)
9. 326.375 326.375 ↑ 1.2 230,490 3 / 3

Parallel Seq Scan on tb_as_portfolio (cost=0.00..52,444.59 rows=287,139 width=16) (actual time=0.027..326.375 rows=230,490 loops=3)

  • Filter: ((id_asset = 97) AND (id_contract = 2020) AND ((tp_tm_portfolio)::text = 'CUSTODY'::text))
  • Rows Removed by Filter: 234350
10. 44.232 725.826 ↑ 1.4 86,152 3 / 3

Parallel Hash (cost=64,401.68..64,401.68 rows=119,931 width=20) (actual time=725.825..725.826 rows=86,152 loops=3)

  • Buckets: 524288 Batches: 1 Memory Usage: 18336kB
11. 443.773 681.594 ↑ 1.4 86,152 3 / 3

Parallel Hash Join (cost=7,965.84..64,401.68 rows=119,931 width=20) (actual time=52.635..681.594 rows=86,152 loops=3)

  • Hash Cond: (tb_asset_fund.id_manager = tb_cei_investors.id)
12. 185.805 185.805 ↑ 1.3 460,981 3 / 3

Parallel Seq Scan on tb_asset_fund (cost=0.00..54,923.18 rows=576,244 width=20) (actual time=0.034..185.805 rows=460,981 loops=3)

  • Filter: (id_asset = 97)
  • Rows Removed by Filter: 2407
13. 20.695 52.016 ↑ 1.2 43,083 3 / 3

Parallel Hash (cost=7,293.61..7,293.61 rows=53,779 width=4) (actual time=52.015..52.016 rows=43,083 loops=3)

  • Buckets: 131072 Batches: 1 Memory Usage: 6144kB
14. 31.321 31.321 ↑ 1.2 43,083 3 / 3

Parallel Seq Scan on tb_cei_investors (cost=0.00..7,293.61 rows=53,779 width=4) (actual time=0.032..31.321 rows=43,083 loops=3)

  • Filter: ((cd_status)::text = ANY ('{SUCCESS,PENDING,RUNNING,SELENIUM_RESTART}'::text[]))
  • Rows Removed by Filter: 26976
Planning time : 1.390 ms
Execution time : 16,543.266 ms