explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6eDE

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Aggregate (cost=367,515.32..367,515.33 rows=1 width=8) (actual rows= loops=)

2.          

CTE a

3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=367,510.81..367,512.20 rows=139 width=33) (actual rows= loops=)

4.          

CTE l

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=74.12..8,571.65 rows=2,721 width=19) (actual rows= loops=)

6.          

CTE o

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.56..16.60 rows=1 width=10) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Index Only Scan using ix_produbi_codice on produbi (cost=0.28..8.29 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codice = 1432)
9. 0.000 0.000 ↓ 0.0

Index Scan using ix_prodord_codprod on prodord (cost=0.28..8.29 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (codprod = 1432)
10. 0.000 0.000 ↓ 0.0

CTE Scan on o (cost=0.00..0.02 rows=1 width=43) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on lottim (cost=57.52..8,527.82 rows=2,721 width=28) (actual rows= loops=)

  • Recheck Cond: ((procord)::text = (o.codop)::text)
12. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_lottim_procord (cost=0.00..56.84 rows=2,721 width=0) (actual rows= loops=)

  • Index Cond: ((procord)::text = (o.codop)::text)
13. 0.000 0.000 ↓ 0.0

Merge Join (cost=349,949.89..358,603.08 rows=67,214 width=33) (actual rows= loops=)

  • Merge Cond: ((m.codlot)::text = (l.codice)::text)
14. 0.000 0.000 ↓ 0.0

Sort (cost=349,740.24..353,562.73 rows=1,528,996 width=23) (actual rows= loops=)

  • Sort Key: m.codlot
15. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on movimag m (cost=28,626.15..129,967.60 rows=1,528,996 width=23) (actual rows= loops=)

  • Recheck Cond: ((codcau)::text = 'PREL'::text)
16. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_movimag_codcau (cost=0.00..28,243.90 rows=1,528,996 width=0) (actual rows= loops=)

  • Index Cond: ((codcau)::text = 'PREL'::text)
17. 0.000 0.000 ↓ 0.0

Sort (cost=209.65..216.45 rows=2,721 width=25) (actual rows= loops=)

  • Sort Key: l.codice
18. 0.000 0.000 ↓ 0.0

CTE Scan on l (cost=0.00..54.42 rows=2,721 width=25) (actual rows= loops=)

19.          

CTE a

20. 0.000 0.000 ↓ 0.0

HashAggregate (cost=367,510.81..367,512.20 rows=139 width=33) (actual rows= loops=)

21.          

CTE l

22. 0.000 0.000 ↓ 0.0

Nested Loop (cost=74.12..8,571.65 rows=2,721 width=19) (actual rows= loops=)

23.          

CTE o

24. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.56..16.60 rows=1 width=10) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Index Only Scan using ix_produbi_codice on produbi (cost=0.28..8.29 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codice = 1432)
26. 0.000 0.000 ↓ 0.0

Index Scan using ix_prodord_codprod on prodord (cost=0.28..8.29 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (codprod = 1432)
27. 0.000 0.000 ↓ 0.0

CTE Scan on o (cost=0.00..0.02 rows=1 width=43) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on lottim (cost=57.52..8,527.82 rows=2,721 width=28) (actual rows= loops=)

  • Recheck Cond: ((procord)::text = (o.codop)::text)
29. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ix_lottim_procord (cost=0.00..56.84 rows=2,721 width=0) (actual rows= loops=)

  • Index Cond: ((procord)::text = (o.codop)::text)
30. 0.000 0.000 ↓ 0.0

Merge Join (cost=349,949.89..358,603.08 rows=67,214 width=33) (actual rows= loops=)

  • Merge Cond: ((m.codlot)::text = (l.codice)::text)
31. 0.000 0.000 ↓ 0.0

Sort (cost=349,740.24..353,562.73 rows=1,528,996 width=23) (actual rows= loops=)

  • Sort Key: m.codlot
32. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on movimag m (cost=28,626.15..129,967.60 rows=1,528,996 width=23) (actual rows= loops=)

  • Recheck Cond: ((codcau)::text = 'PREL'::text)
33. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_movimag_codcau (cost=0.00..28,243.90 rows=1,528,996 width=0) (actual rows= loops=)

  • Index Cond: ((codcau)::text = 'PREL'::text)
34. 0.000 0.000 ↓ 0.0

Sort (cost=209.65..216.45 rows=2,721 width=25) (actual rows= loops=)

  • Sort Key: l.codice
35. 0.000 0.000 ↓ 0.0

CTE Scan on l (cost=0.00..54.42 rows=2,721 width=25) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

CTE Scan on a (cost=0.00..2.78 rows=139 width=8)Aggregate (cost=367,515.32..367,515.33 rows=1 width=8) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

CTE Scan on a (cost=0.00..2.78 rows=139 width=8) (actual rows= loops=)