explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oURo : Insert on ts_mth

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

Insert on ts_mth (cost=112,498.41..112,498.56 rows=1 width=154) (actual rows= loops=)

2.          

CTE qw1

3. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=112,497.05..112,498.41 rows=33 width=200) (actual rows= loops=)

  • Group Key: m.ts_operator, m.ts_faceaccount, m.ts_number
  • Filter: (sum(CASE WHEN (m.ts_typesc = ANY ('{22,23,25,27}'::integer[])) THEN (- m.ts_mthsumma) ELSE m.ts_mthsumma END) > '0'::numeric)
4. 0.000 0.000 ↓ 0.0

Sort (cost=112,497.05..112,497.14 rows=33 width=45) (actual rows= loops=)

  • Sort Key: m.ts_faceaccount, m.ts_number
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=419.83..112,496.22 rows=33 width=45) (actual rows= loops=)

  • Join Filter: (btrim((nl.ts_number)::text) = btrim((m.ts_number)::text))
6. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on ts_mth m (cost=419.83..33,196.61 rows=97 width=50) (actual rows= loops=)

  • Recheck Cond: (ts_operator = 3)
  • Filter: ((btrim((ts_mth)::text) = '1812'::text) AND (ts_typesc = ANY ('{1,22,23,25,27,29,30}'::integer[])))
7. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ts_operator_hg (cost=0.00..419.81 rows=24,717 width=0) (actual rows= loops=)

  • Index Cond: (ts_operator = 3)
8. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..79,226.16 rows=69 width=18) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..79,225.81 rows=69 width=18) (actual rows= loops=)

  • Join Filter: (btrim((nl.ts_abonenty)::text) = btrim(dc.ts_abonenty))
10. 0.000 0.000 ↓ 0.0

Seq Scan on data_card dc (cost=0.00..388.03 rows=1 width=17) (actual rows= loops=)

  • Filter: ((btrim(yymm) = '1812'::text) AND (btrim(node) = '10'::text))
11. 0.000 0.000 ↓ 0.0

Seq Scan on ts_number_last nl (cost=0.00..78,720.57 rows=13,790 width=43) (actual rows= loops=)

  • Filter: (btrim((yymm)::text) = '1812'::text)
12. 0.000 0.000 ↓ 0.0

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

13. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..0.15 rows=1 width=168) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

CTE Scan on qw1 (cost=0.00..0.15 rows=1 width=168) (actual rows= loops=)

  • Filter: (ts_mth = '1812'::text)