explain.depesz.com

PostgreSQL's explain analyze made readable

Result: i8XI : Optimization for: plan #y6H5

Settings

Optimization path:

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

Hash Join (cost=3,447.14..3,485.46 rows=805 width=174) (actual rows= loops=)

  • Hash Cond: (alle_belege.belegnr = "ANY_subquery".belegnr)
2.          

CTE alle_belege

3. 0.000 0.000 ↓ 0.0

Result (cost=225.46..3,366.60 rows=1,610 width=75) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Append (cost=225.46..3,366.60 rows=1,610 width=75) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on losbeleg (cost=225.46..2,001.13 rows=877 width=75) (actual rows= loops=)

  • Recheck Cond: ((belegnr >= 2019040000000::numeric) AND (belegnr <= 2019049999999::numeric))
6. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on losbeleg_pkey (cost=0.00..225.24 rows=877 width=0) (actual rows= loops=)

  • Index Cond: ((belegnr >= 2019040000000::numeric) AND (belegnr <= 2019049999999::numeric))
7. 0.000 0.000 ↓ 0.0

Index Scan using losbeleg_hist_pkey on losbeleg_hist (cost=0.00..1,349.36 rows=733 width=75) (actual rows= loops=)

  • Index Cond: ((belegnr >= 2019040000000::numeric) AND (belegnr <= 2019049999999::numeric))
8. 0.000 0.000 ↓ 0.0

CTE Scan on alle_belege (cost=0.00..32.20 rows=1,610 width=174) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash (cost=80.53..80.53 rows=1 width=16) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Subquery Scan on ANY_subquery (cost=0.00..80.53 rows=1 width=16) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

HashSetOp Except (cost=0.00..80.52 rows=1 width=16) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Append (cost=0.00..80.52 rows=2 width=16) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=0.00..40.26 rows=1 width=16) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

CTE Scan on alle_belege (cost=0.00..40.25 rows=1 width=16) (actual rows= loops=)

  • Filter: ((buchungskz = ANY ('{AK,AD}'::bpchar[])) AND (buchungsstatus = 'e'::bpchar))
15. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=0.00..40.26 rows=1 width=16) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

CTE Scan on alle_belege (cost=0.00..40.25 rows=1 width=16) (actual rows= loops=)

  • Filter: ((buchungskz = ANY ('{SK,SD}'::bpchar[])) AND (buchungsstatus = 'e'::bpchar))