explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8Z56

Settings
# exclusive inclusive rows x rows loops node
1. 68,876.412 68,876.412 ↑ 208,530,352.0 1 1

CTE Scan on dadositem tb (cost=406,281,057.42..410,451,664.46 rows=208,530,352 width=2,294) (actual time=68,876.410..68,876.412 rows=1 loops=1)

2.          

CTE dadositem

3. 0.053 68,876.405 ↑ 208,530,352.0 1 1

Sort (cost=405,759,731.54..406,281,057.42 rows=208,530,352 width=2,294) (actual time=68,876.404..68,876.405 rows=1 loops=1)

  • Sort Key: ib.idfilial, ib.iditembase
  • Sort Method: quicksort Memory: 25kB
4. 0.037 68,876.352 ↑ 208,530,352.0 1 1

Nested Loop (cost=22,302,369.69..22,606,650.91 rows=208,530,352 width=2,294) (actual time=68,876.318..68,876.352 rows=1 loops=1)

5. 0.000 68,876.223 ↑ 40,000.0 1 1

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

  • Group Key: ibk.iditembase, ibk.idfilial
6. 65.846 68,894.926 ↑ 54,217,565.0 1 1

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

  • Workers Planned: 2
  • Workers Launched: 2
7. 21.882 68,829.080 ↓ 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=68,809.837..68,829.080 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.154 0.203 ↓ 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.202..0.203 rows=0 loops=3)

  • Recheck Cond: (((idfilial)::integer = 10,002) AND ((idpedidovenda)::integer = 6,000,228))
9. 0.049 0.049 ↑ 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.147..0.148 rows=1 loops=1)

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

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

  • Buckets: 1,048,576 Batches: 1 Memory Usage: 23,104kB
11. 68,662.238 68,692.721 ↑ 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=162.618..68,692.721 rows=126,423 loops=3)

  • Recheck Cond: ((idfilial)::integer = 10,002)
  • Heap Blocks: exact=71,890
12. 30.483 30.483 ↑ 2.7 379,406 1 / 3

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

  • Index Cond: ((idfilial)::integer = 10,002)
13. 0.043 0.092 ↑ 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.092..0.092 rows=1 loops=1)

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

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

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