explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2hOP

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

Group (cost=1,638.51..1,638.60 rows=1 width=133) (actual time=0.273..0.273 rows=0 loops=1)

  • Group Key: rev.periodstart, rev.invdocref, rev.finalinvoiceid, rev.periodend, rev.invoicedate, rev.vatamount, rev.amount, rev.invoiceid
2. 0.120 0.273 ↓ 0.0 0 1

Sort (cost=1,638.51..1,638.51 rows=1 width=101) (actual time=0.273..0.273 rows=0 loops=1)

  • Sort Key: rev.periodstart DESC, rev.invdocref, rev.finalinvoiceid, rev.periodend, rev.invoicedate, rev.vatamount, rev.amount, rev.invoiceid
  • Sort Method: quicksort Memory: 25kB
3. 0.000 0.153 ↓ 0.0 0 1

Subquery Scan on rev (cost=1,638.42..1,638.50 rows=1 width=101) (actual time=0.153..0.153 rows=0 loops=1)

4. 0.002 0.153 ↓ 0.0 0 1

GroupAggregate (cost=1,638.42..1,638.49 rows=1 width=116) (actual time=0.153..0.153 rows=0 loops=1)

  • Group Key: i.invoiceid, ir.finalinvoiceid, id.invdocid, prop.value
5. 0.015 0.151 ↓ 0.0 0 1

Sort (cost=1,638.42..1,638.42 rows=1 width=93) (actual time=0.151..0.151 rows=0 loops=1)

  • Sort Key: i.invoiceid, id.invdocid, prop.value
  • Sort Method: quicksort Memory: 25kB
6. 0.001 0.136 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.43..1,638.41 rows=1 width=93) (actual time=0.136..0.136 rows=0 loops=1)

  • Join Filter: (((pv.internalparametervaluecode)::text ~~ '15'::text) OR ((pv.internalparametervaluecode)::text = '16'::text))
7. 0.000 0.135 ↓ 0.0 0 1

Nested Loop (cost=2.16..1,636.11 rows=1 width=97) (actual time=0.135..0.135 rows=0 loops=1)

8. 0.000 0.135 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.89..1,633.88 rows=1 width=90) (actual time=0.135..0.135 rows=0 loops=1)

9. 0.000 0.135 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.31..7.92 rows=1 width=53) (actual time=0.134..0.135 rows=0 loops=1)

10. 0.001 0.135 ↓ 0.0 0 1

Nested Loop (cost=0.87..5.50 rows=1 width=20) (actual time=0.134..0.135 rows=0 loops=1)

11. 0.134 0.134 ↓ 0.0 0 1

Index Scan using index_invoicerelation_finalinvoiceid on invoicerelation ir (cost=0.44..3.04 rows=1 width=8) (actual time=0.134..0.134 rows=0 loops=1)

  • Index Cond: (finalinvoiceid = 1)
  • Filter: ((nature)::text = '11'::text)
12. 0.000 0.000 ↓ 0.0 0

Index Scan using invoice_pkey on invoice i (cost=0.43..2.45 rows=1 width=16) (never executed)

  • Index Cond: (invoiceid = ir.originalinvoiceid)
13. 0.000 0.000 ↓ 0.0 0

Index Scan using invdoc_invoiceid on invdoc id (cost=0.43..2.41 rows=1 width=37) (never executed)

  • Index Cond: (invoiceid = i.invoiceid)
14. 0.000 0.000 ↓ 0.0 0

Index Scan using invdocline_invdocid_index on invdocline idl (cost=0.58..1,625.68 rows=28 width=41) (never executed)

  • Index Cond: (invdocid = id.invdocid)
  • Filter: (((contrib)::text = '12'::text) OR ((resultset)::text ~~ '13'::text))
15. 0.000 0.000 ↓ 0.0 0

Index Scan using parametervalueid on parametervalue pv (cost=0.28..2.22 rows=1 width=15) (never executed)

  • Index Cond: (parametervalueid = i.invoicenatureparamid)
16. 0.000 0.000 ↓ 0.0 0

Index Scan using property_pkey on property prop (cost=0.27..2.29 rows=1 width=7) (never executed)

  • Index Cond: ((propertycode)::text = '14'::text)
Planning time : 532.121 ms