explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NxIkl

Settings
# exclusive inclusive rows x rows loops node
1. 1,104.081 1,104.081 ↑ 208,530,368.0 1 1

CTE Scan on dadositem tb (cost=406,281,083.78..410,451,691.14 rows=208,530,368 width=2,294) (actual time=1,104.080..1,104.081 rows=1 loops=1)

2.          

CTE dadositem

3. 0.053 1,104.070 ↑ 208,530,368.0 1 1

Sort (cost=405,759,757.86..406,281,083.78 rows=208,530,368 width=2,294) (actual time=1,104.069..1,104.070 rows=1 loops=1)

  • Sort Key: ib.idfilial, ib.iditembase
  • Sort Method: quicksort Memory: 25kB
4. 0.035 1,104.017 ↑ 208,530,368.0 1 1

Nested Loop (cost=22,302,369.69..22,606,650.91 rows=208,530,368 width=2,294) (actual time=1,103.983..1,104.017 rows=1 loops=1)

5. 0.000 1,103.888 ↑ 40,000.0 1 1

HashAggregate (cost=22,302,364.90..22,302,764.90 rows=40,000 width=8) (actual time=1,103.855..1,103.888 rows=1 loops=1)

  • Group Key: ibk.iditembase, ibk.idfilial
6. 51.459 1,114.140 ↑ 54,217,565.0 1 1

Gather (cost=2,322,160.06..22,031,277.08 rows=54,217,565 width=8) (actual time=1,050.572..1,114.140 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 20.195 1,062.681 ↓ 0.0 0 3 / 3

Parallel Hash Left Join (cost=2,321,160.06..16,608,520.58 rows=22,590,652 width=8) (actual time=1,045.122..1,062.681 rows=0 loops=3)

  • Hash Cond: ((ibc.idfilial)::integer = (ibk.idfilial)::integer)
  • Join Filter: (((ibk.iditembase)::integer = (ibc.iditembasereferentekit)::integer) OR ((ibk.iditembase)::integer = (ibc.iditembase)::integer))
  • Rows Removed by Join Filter: 126,423
8. 0.063 0.085 ↓ 0.0 0 3 / 3

Parallel Bitmap Heap Scan on itembase ibc (cost=117.00..15,531.59 rows=2,172 width=12) (actual time=0.084..0.085 rows=0 loops=3)

  • Recheck Cond: (((idfilial)::integer = 10,002) AND ((idpedidovenda)::integer = 6,000,228))
  • Heap Blocks: exact=1
9. 0.022 0.022 ↑ 5,213.0 1 1 / 3

Bitmap Index Scan on ix_itembase_iditempedidovenda (cost=0.00..115.70 rows=5,213 width=0) (actual time=0.065..0.065 rows=1 loops=1)

  • Index Cond: (((idfilial)::integer = 10,002) AND ((idpedidovenda)::integer = 6,000,228))
10. 47.462 1,042.401 ↑ 3.4 126,423 3 / 3

Parallel Hash (cost=2,315,612.58..2,315,612.58 rows=434,438 width=8) (actual time=1,042.401..1,042.401 rows=126,423 loops=3)

  • Buckets: 1,048,576 Batches: 1 Memory Usage: 23,072kB
11. 962.793 994.939 ↑ 3.4 126,423 3 / 3

Parallel Bitmap Heap Scan on itembase ibk (cost=16,658.12..2,315,612.58 rows=434,438 width=8) (actual time=166.333..994.939 rows=126,423 loops=3)

  • Recheck Cond: ((idfilial)::integer = 10,002)
  • Heap Blocks: exact=74,864
12. 32.146 32.146 ↑ 2.7 379,270 1 / 3

Bitmap Index Scan on pk_itembase (cost=0.00..16,397.46 rows=1,042,652 width=0) (actual time=96.437..96.437 rows=379,270 loops=1)

  • Index Cond: ((idfilial)::integer = 10,002)
13. 0.030 0.094 ↑ 5,213.0 1 1

Bitmap Heap Scan on itembase ib (cost=4.78..14,615.89 rows=5,213 width=2,286) (actual time=0.094..0.094 rows=1 loops=1)

  • Recheck Cond: (((idfilial)::integer = (ibk.idfilial)::integer) AND ((iditembase)::integer = (ibk.iditembase)::integer))
  • Heap Blocks: exact=1
14. 0.064 0.064 ↑ 5,213.0 1 1

Bitmap Index Scan on pk_itembase (cost=0.00..3.48 rows=5,213 width=0) (actual time=0.064..0.064 rows=1 loops=1)

  • Index Cond: (((idfilial)::integer = (ibk.idfilial)::integer) AND ((iditembase)::integer = (ibk.iditembase)::integer))