explain.depesz.com

PostgreSQL's explain analyze made readable

Result: W2JV

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 10,127.224 ↑ 5.0 1 1

Nested Loop (cost=0.33..21.87 rows=5 width=128) (actual time=10,127.221..10,127.224 rows=1 loops=1)

2. 0.021 0.044 ↑ 1.0 1 1

Index Scan using _reference22_pkey on _reference22 t13 (cost=0.11..1.25 rows=1 width=40) (actual time=0.043..0.044 rows=1 loops=1)

  • Index Cond: (_idrref = '\\xda92000c2926e34911e520906cb71a48'::bytea)
  • Filter: (SubPlan 1)
3.          

SubPlan (forIndex Scan)

4. 0.005 0.023 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.00..0.32 rows=1 width=0) (actual time=0.023..0.023 rows=1 loops=1)

  • Join Filter: (((CASE WHEN ((t13._ownerid_type = '\\x08'::bytea) AND (t13._ownerid_rtref = '\\x0000004a'::bytea)) THEN t14._fld1304rref ELSE NULL::bytea END <> '\\x00000000000000000000000000000000'::bytea) AND ((CASE WHEN ((t13._ownerid_type = '\\x08'::bytea) AND (t13._ownerid_rtref = '\\x0000004a'::bytea)) THEN t14._fld1304rref ELSE NULL::bytea END = t15._fld1304rref) OR (CASE WHEN ((t13._ownerid_type = '\\x08'::bytea) AND (t13._ownerid_rtref = '\\x0000004a'::bytea)) THEN t14._fld1304rref ELSE NULL::bytea END = t15._idrref))) OR ((t13._ownerid_type = CASE WHEN (t15._fld1304rref IS NOT NULL) THEN '\\x08'::bytea ELSE NULL::bytea END) AND (t13._ownerid_rtref = CASE WHEN (t15._fld1304rref IS NOT NULL) THEN '\\x0000004a'::bytea ELSE NULL::bytea END) AND (t13._ownerid_rrref = t15._fld1304rref)) OR ((t13._ownerid_type = CASE WHEN (t15._idrref IS NOT NULL) THEN '\\x08'::bytea ELSE NULL::bytea END) AND (t13._ownerid_rtref = CASE WHEN (t15._idrref IS NOT NULL) THEN '\\x0000004a'::bytea ELSE NULL::bytea END) AND (t13._ownerid_rrref = t15._idrref)))
  • Rows Removed by Join Filter: 1
5. 0.002 0.013 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.00..0.15 rows=1 width=32) (actual time=0.013..0.013 rows=1 loops=1)

  • Join Filter: ((t13._ownerid_type = '\\x08'::bytea) AND (t13._ownerid_rtref = '\\x0000004a'::bytea))
6. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1)

7. 0.010 0.010 ↑ 1.0 1 1

Seq Scan on _reference74 t14 (cost=0.00..0.12 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=1)

  • Filter: (t13._ownerid_rrref = _idrref)
  • Rows Removed by Filter: 1
8. 0.005 0.005 ↑ 1.0 2 1

Seq Scan on _reference74 t15 (cost=0.00..0.12 rows=2 width=64) (actual time=0.005..0.005 rows=2 loops=1)

9. 2.688 10,127.170 ↑ 5.0 1 1

GroupAggregate (cost=0.22..20.50 rows=5 width=286) (actual time=10,127.170..10,127.170 rows=1 loops=1)

  • Group Key: "*SELECT* 1".value1_type, "*SELECT* 1".value1_rtref, "*SELECT* 1".value1_rrref
  • Filter: ((CASE WHEN (sum("*SELECT* 1".fld606turnoverdt_) IS NULL) THEN '0'::numeric ELSE sum("*SELECT* 1".fld606turnoverdt_) END <> '0'::numeric) OR (CASE WHEN (sum("*SELECT* 1".fld606turnoverct_) IS NULL) THEN '0'::numeric ELSE sum("*SELECT* 1".fld606turnoverct_) END <> '0'::numeric) OR (CASE WHEN (sum("*SELECT* 1".fld606balance_) IS NULL) THEN '0'::numeric ELSE sum("*SELECT* 1".fld606balance_) END <> '0'::numeric) OR (CASE WHEN (sum(("*SELECT* 1".fld606balance_ + "*SELECT* 1".fld606finalturnover_)) IS NULL) THEN '0'::numeric ELSE sum(("*SELECT* 1".fld606balance_ + "*SELECT* 1".fld606finalturnover_)) END <> '0'::numeric) OR (CASE WHEN (sum("*SELECT* 1".fld605turnoverdt_) IS NULL) THEN '0'::numeric ELSE sum("*SELECT* 1".fld605turnoverdt_) END <> '0'::numeric) OR (CASE WHEN (sum("*SELECT* 1".fld605turnoverct_) IS NULL) THEN '0'::numeric ELSE sum("*SELECT* 1".fld605turnoverct_) END <> '0'::numeric) OR (CASE WHEN (sum("*SELECT* 1".fld605balance_) IS NULL) THEN '0'::numeric ELSE sum("*SELECT* 1".fld605balance_) END <> '0'::numeric) OR (CASE WHEN (sum(("*SELECT* 1".fld605balance_ + "*SELECT* 1".fld605finalturnover_)) IS NULL) THEN '0'::numeric ELSE sum(("*SELECT* 1".fld605balance_ + "*SELECT* 1".fld605finalturnover_)) END <> '0'::numeric))
10. 10,124.329 10,124.482 ↓ 221.8 1,109 1

Append (cost=0.22..20.08 rows=5 width=218) (actual time=0.123..10,124.482 rows=1,109 loops=1)

11. 0.002 0.153 ↓ 4.0 4 1

Subquery Scan on *SELECT* 1 (cost=0.22..11.84 rows=1 width=224) (actual time=0.123..0.153 rows=4 loops=1)

12. 0.014 0.151 ↓ 4.0 4 1

Nested Loop (cost=0.22..11.83 rows=1 width=196) (actual time=0.122..0.151 rows=4 loops=1)

13. 0.016 0.016 ↑ 1.0 11 1

Seq Scan on tt1 t4 (cost=0.00..0.23 rows=11 width=17) (actual time=0.010..0.016 rows=11 loops=1)

  • Filter: ((_lineno1 = '1'::numeric) AND (_cnt = '2'::numeric))
14. 0.121 0.121 ↓ 0.0 0 11

Index Scan using _accrgat2634_byperiod_rtrrrrrn on _accrgat2634 t3 (cost=0.22..1.04 rows=1 width=55) (actual time=0.009..0.011 rows=0 loops=11)

  • Index Cond: ((_accountrref = t4._idrref) AND (_period = '2019-03-01 00:00:00'::timestamp without time zone) AND (_fld602rref = '\\x96d9000c6e46fcad11dd3c48f966000c'::bytea) AND (_value1_type = '\\x08'::bytea) AND (_value1_rtref = '\\x00000016'::bytea) AND (_value1_rrref = '\\xda92000c2926e34911e520906cb71a48'::bytea))
  • Filter: ((_fld606 <> '0'::numeric) OR (_turnover620 <> '0'::numeric) OR (_fld605 <> '0'::numeric) OR (_turnover617 <> '0'::numeric))
  • Rows Removed by Filter: 0