explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MM3O

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

Nested Loop (cost=364.17..749,408.91 rows=62,991 width=165) (actual rows= loops=)

2.          

CTE runids

3. 0.000 0.000 ↓ 0.0

Values Scan on "*VALUES*" (cost=0.00..0.01 rows=1 width=4) (actual rows= loops=)

4.          

CTE discounttext

5. 0.000 0.000 ↓ 0.0

HashAggregate (cost=27.95..27.96 rows=1 width=30) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Seq Scan on invprestemplateline (cost=0.00..27.95 rows=1 width=30) (actual rows= loops=)

  • Filter: ((text)::text ~~ '==DISCOUNT_LABELS;%'::text)
7.          

CTE rateitemtext

8. 0.000 0.000 ↓ 0.0

HashAggregate (cost=27.96..27.98 rows=2 width=30) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Seq Scan on invprestemplateline invprestemplateline_1 (cost=0.00..27.95 rows=4 width=30) (actual rows= loops=)

  • Filter: ((text)::text ~~ '==RATEITEM_LABELS;%'::text)
10.          

CTE templatelineids

11. 0.000 0.000 ↓ 0.0

Hash Join (cost=37.39..307.65 rows=12,583 width=80) (actual rows= loops=)

  • Hash Cond: (p.invprestemplateid = tl_1.invprestemplateid)
12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..51.28 rows=208 width=12) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..2.33 rows=1 width=4) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

CTE Scan on runids ri (cost=0.00..0.02 rows=1 width=4) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Index Scan using invpresrun_invdocrunid_index on invpresrun d (cost=0.28..2.30 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (invdocrunid = ri.invdocrunid)
16. 0.000 0.000 ↓ 0.0

Index Scan using invpres_invpresrunid_index on invpres p (cost=0.43..34.50 rows=1,445 width=16) (actual rows= loops=)

  • Index Cond: (invpresrunid = d.invpresrunid)
17. 0.000 0.000 ↓ 0.0

Hash (cost=25.76..25.76 rows=874 width=76) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on invprestemplateline tl_1 (cost=0.00..25.76 rows=874 width=76) (actual rows= loops=)

  • Filter: active
19. 0.000 0.000 ↓ 0.0

CTE Scan on templatelineids tl (cost=0.00..251.66 rows=12,583 width=108) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Index Scan using invdocline_invdocid_index on invdocline l (cost=0.56..59.46 rows=5 width=65) (actual rows= loops=)

  • Index Cond: (invdocid = tl.invdocid)
  • Filter: ((resultset)::text ~~* tl.resultfilter)