explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 86hR

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 495.507 ↑ 1.0 5 1

Subquery Scan on result (cost=1.26..40,371.61 rows=5 width=428) (actual time=212.717..495.507 rows=5 loops=1)

2. 0.018 0.373 ↑ 1.0 5 1

Limit (cost=1.26..7.37 rows=5 width=396) (actual time=0.077..0.373 rows=5 loops=1)

3. 0.042 0.355 ↑ 9,848.6 5 1

Nested Loop (cost=1.26..60,190.42 rows=49,243 width=396) (actual time=0.076..0.355 rows=5 loops=1)

4. 0.021 0.298 ↑ 9,848.6 5 1

Nested Loop Left Join (cost=1.26..58,588.98 rows=49,243 width=195) (actual time=0.065..0.298 rows=5 loops=1)

5. 0.018 0.237 ↑ 9,848.6 5 1

Nested Loop Left Join (cost=0.98..43,377.36 rows=49,243 width=174) (actual time=0.056..0.237 rows=5 loops=1)

6. 0.025 0.194 ↑ 9,848.6 5 1

Nested Loop (cost=0.70..28,949.33 rows=49,243 width=144) (actual time=0.050..0.194 rows=5 loops=1)

  • Join Filter: (ev.c_element_id = e.c_element_id)
7. 0.031 0.164 ↑ 9,848.6 5 1

Nested Loop (cost=0.70..27,717.23 rows=49,243 width=155) (actual time=0.043..0.164 rows=5 loops=1)

8. 0.009 0.073 ↑ 9,848.6 5 1

Nested Loop (cost=0.43..13,289.72 rows=49,243 width=107) (actual time=0.035..0.073 rows=5 loops=1)

9. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on ad_org o (cost=0.00..1.04 rows=1 width=5) (actual time=0.009..0.009 rows=1 loops=1)

  • Filter: (ad_org_id = '5000000'::numeric)
  • Rows Removed by Filter: 1
10. 0.055 0.055 ↑ 9,848.6 5 1

Index Scan using idx_fact_acct_dateacct_funcao on fact_acct f (cost=0.43..12,796.25 rows=49,243 width=126) (actual time=0.024..0.055 rows=5 loops=1)

  • Index Cond: (((dateacct)::date >= '2018-07-06'::date) AND ((dateacct)::date <= '2018-08-10'::date))
  • Filter: ((ad_org_id = '5000000'::numeric) AND (ad_client_id = '5000000'::numeric) AND (c_acctschema_id = '5000000'::numeric) AND (postingtype = 'A'::bpchar))
11. 0.060 0.060 ↑ 1.0 1 5

Index Scan using c_elementvalue_pkey on c_elementvalue ev (cost=0.28..0.29 rows=1 width=48) (actual time=0.012..0.012 rows=1 loops=5)

  • Index Cond: (c_elementvalue_id = f.account_id)
12. 0.002 0.005 ↑ 2.0 1 5

Materialize (cost=0.00..1.03 rows=2 width=13) (actual time=0.001..0.001 rows=1 loops=5)

13. 0.003 0.003 ↑ 2.0 1 1

Seq Scan on c_element e (cost=0.00..1.02 rows=2 width=13) (actual time=0.003..0.003 rows=1 loops=1)

14. 0.025 0.025 ↑ 1.0 1 5

Index Scan using c_elementvalue_pkey on c_elementvalue ev1 (cost=0.28..0.29 rows=1 width=43) (actual time=0.005..0.005 rows=1 loops=5)

  • Index Cond: (f.user1_id = c_elementvalue_id)
15. 0.040 0.040 ↑ 1.0 1 5

Index Scan using c_bpartner_pkey on c_bpartner bp (cost=0.28..0.31 rows=1 width=33) (actual time=0.008..0.008 rows=1 loops=5)

  • Index Cond: (f.c_bpartner_id = c_bpartner_id)
16. 0.005 0.015 ↑ 1.0 1 5

Materialize (cost=0.00..1.05 rows=1 width=24) (actual time=0.001..0.003 rows=1 loops=5)

17. 0.010 0.010 ↑ 1.0 1 1

Seq Scan on ad_orginfo oi (cost=0.00..1.04 rows=1 width=24) (actual time=0.005..0.010 rows=1 loops=1)

  • Filter: ((ad_org_id = '5000000'::numeric) AND ((lbr_cnpj)::text = '11.442.133/0001-34'::text))
  • Rows Removed by Filter: 2
18.          

SubPlan (forSubquery Scan)

19. 213.010 495.095 ↑ 1.0 1 5

Aggregate (cost=8,072.83..8,072.84 rows=1 width=32) (actual time=99.019..99.019 rows=1 loops=5)

20. 169.980 282.085 ↓ 10.5 81,684 5

Bitmap Heap Scan on fact_acct (cost=172.36..8,033.77 rows=7,812 width=8) (actual time=24.481..56.417 rows=81,684 loops=5)

  • Recheck Cond: ((account_id = result.account_id) AND (dateacct < '2018-07-06 00:00:00'::timestamp without time zone) AND (ad_org_id = '5000000'::numeric) AND (c_acctschema_id = '5000000'::numeric))
  • Heap Blocks: exact=61345
21. 112.105 112.105 ↓ 10.5 81,684 5

Bitmap Index Scan on idx_fact_acct_account_dateacct_org_acctschema (cost=0.00..170.41 rows=7,812 width=0) (actual time=22.421..22.421 rows=81,684 loops=5)

  • Index Cond: ((account_id = result.account_id) AND (dateacct < '2018-07-06 00:00:00'::timestamp without time zone) AND (ad_org_id = '5000000'::numeric) AND (c_acctschema_id = '5000000'::numeric))