explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ethM

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 438.327 ↑ 4.7 3 1

Limit (cost=3,974.32..3,974.36 rows=14 width=227) (actual time=438.326..438.327 rows=3 loops=1)

2. 0.022 438.324 ↑ 4.7 3 1

Sort (cost=3,974.32..3,974.36 rows=14 width=227) (actual time=438.323..438.324 rows=3 loops=1)

  • Sort Key: a.number DESC, a.id DESC
  • Sort Method: quicksort Memory: 25kB
3. 0.037 438.302 ↑ 4.7 3 1

Nested Loop (cost=3,969.16..3,974.06 rows=14 width=227) (actual time=438.265..438.302 rows=3 loops=1)

4. 0.097 438.202 ↑ 4.7 3 1

HashAggregate (cost=3,968.87..3,969.01 rows=14 width=4) (actual time=438.199..438.202 rows=3 loops=1)

  • Group Key: b.invoice
5. 112.321 438.105 ↑ 4.7 3 1

Hash Semi Join (cost=7.94..3,968.84 rows=14 width=4) (actual time=438.094..438.105 rows=3 loops=1)

  • Hash Cond: (("substring"((b.origin)::text, ("position"((b.origin)::text, ','::text) + 1)))::integer = c.id)
6. 325.742 325.742 ↓ 1.0 88,613 1

Seq Scan on account_invoice_line b (cost=0.00..3,672.69 rows=88,605 width=20) (actual time=0.096..325.742 rows=88,613 loops=1)

  • Filter: (((origin)::text ~~* 'sale.line,%'::text) AND (company = 1))
  • Rows Removed by Filter: 6,903
7. 0.003 0.042 ↑ 16.0 1 1

Hash (cost=7.74..7.74 rows=16 width=4) (actual time=0.042..0.042 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.003 0.039 ↑ 16.0 1 1

Nested Loop (cost=0.70..7.74 rows=16 width=4) (actual time=0.037..0.039 rows=1 loops=1)

9. 0.019 0.019 ↑ 1.0 1 1

Index Scan using sale_sale_pkey on sale_sale d (cost=0.29..2.51 rows=1 width=4) (actual time=0.019..0.019 rows=1 loops=1)

  • Index Cond: (id = 9,015)
  • Filter: (company = 1)
10. 0.017 0.017 ↑ 16.0 1 1

Index Scan using sale_line_sale_index on sale_line c (cost=0.42..5.08 rows=16 width=8) (actual time=0.016..0.017 rows=1 loops=1)

  • Index Cond: (sale = 9,015)
11. 0.063 0.063 ↑ 1.0 1 3

Index Scan using account_invoice_pkey on account_invoice a (cost=0.29..0.35 rows=1 width=195) (actual time=0.021..0.021 rows=1 loops=3)

  • Index Cond: (id = b.invoice)
  • Filter: (company = 1)