explain.depesz.com

PostgreSQL's explain analyze made readable

Result: v1uY

Settings
# exclusive inclusive rows x rows loops node
1. 0.024 424.664 ↑ 1.0 5 1

Limit (cost=17,141.55..58,309.98 rows=5 width=436) (actual time=325.212..424.664 rows=5 loops=1)

2. 0.050 424.640 ↑ 9,848.6 5 1

Result (cost=17,141.55..405,468,524.39 rows=49,243 width=436) (actual time=325.210..424.640 rows=5 loops=1)

3. 42.231 300.455 ↑ 9,848.6 5 1

Sort (cost=17,141.55..17,264.66 rows=49,243 width=410) (actual time=300.449..300.455 rows=5 loops=1)

  • Sort Key: ev.value, f.dateacct, ((((f.ad_table_id)::text || ''::text) || (f.record_id)::text)), eev.value
  • Sort Method: top-N heapsort Memory: 27kB
4. 68.819 258.224 ↑ 1.0 47,628 1

Hash Left Join (cost=632.45..16,323.64 rows=49,243 width=410) (actual time=6.706..258.224 rows=47,628 loops=1)

  • Hash Cond: (f.user1_id = eev.c_elementvalue_id)
5. 27.729 189.102 ↑ 1.0 47,628 1

Hash Left Join (cost=598.89..15,175.44 rows=49,243 width=215) (actual time=6.391..189.102 rows=47,628 loops=1)

  • Hash Cond: (f.account_id = ev.c_elementvalue_id)
6. 26.607 161.012 ↑ 1.0 47,628 1

Hash Left Join (cost=565.33..15,011.77 rows=49,243 width=179) (actual time=6.020..161.012 rows=47,628 loops=1)

  • Hash Cond: (f.c_bpartner_id = bp.c_bpartner_id)
7. 10.593 128.982 ↑ 1.0 47,628 1

Nested Loop (cost=35.03..14,352.13 rows=49,243 width=158) (actual time=0.580..128.982 rows=47,628 loops=1)

8. 0.002 0.023 ↑ 1.0 1 1

Nested Loop (cost=0.00..2.09 rows=1 width=29) (actual time=0.019..0.023 rows=1 loops=1)

9. 0.012 0.012 ↑ 1.0 1 1

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

  • Filter: (ad_org_id = '5000000'::numeric)
  • Rows Removed by Filter: 2
10. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on ad_orginfo oi (cost=0.00..1.04 rows=1 width=24) (actual time=0.006..0.009 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
11. 24.115 118.366 ↑ 1.0 47,628 1

Hash Join (cost=35.03..13,857.61 rows=49,243 width=144) (actual time=0.559..118.366 rows=47,628 loops=1)

  • Hash Cond: (ev_1.c_element_id = e.c_element_id)
12. 29.486 94.242 ↑ 1.0 47,628 1

Hash Join (cost=33.98..13,453.38 rows=49,243 width=155) (actual time=0.541..94.242 rows=47,628 loops=1)

  • Hash Cond: (f.account_id = ev_1.c_elementvalue_id)
13. 15.840 64.254 ↑ 1.0 47,628 1

Nested Loop (cost=0.43..13,289.72 rows=49,243 width=107) (actual time=0.031..64.254 rows=47,628 loops=1)

14. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on ad_org o_1 (cost=0.00..1.04 rows=1 width=5) (actual time=0.003..0.007 rows=1 loops=1)

  • Filter: (ad_org_id = '5000000'::numeric)
  • Rows Removed by Filter: 2
15. 48.407 48.407 ↑ 1.0 47,628 1

Index Scan using fact_acct_dateacct on fact_acct f (cost=0.43..12,796.25 rows=49,243 width=126) (actual time=0.027..48.407 rows=47,628 loops=1)

  • Index Cond: ((dateacct >= '2018-07-06 00:00:00'::timestamp without time zone) AND (dateacct <= '2018-08-10 00:00:00'::timestamp without time zone))
  • Filter: ((ad_org_id = '5000000'::numeric) AND (ad_client_id = '5000000'::numeric) AND (c_acctschema_id = '5000000'::numeric) AND (postingtype = 'A'::bpchar))
16. 0.213 0.502 ↑ 1.0 647 1

Hash (cost=25.47..25.47 rows=647 width=48) (actual time=0.502..0.502 rows=647 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 61kB
17. 0.289 0.289 ↑ 1.0 647 1

Seq Scan on c_elementvalue ev_1 (cost=0.00..25.47 rows=647 width=48) (actual time=0.008..0.289 rows=647 loops=1)

18. 0.005 0.009 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=13) (actual time=0.009..0.009 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
19. 0.004 0.004 ↑ 1.0 2 1

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

20. 2.131 5.423 ↑ 1.0 6,769 1

Hash (cost=445.69..445.69 rows=6,769 width=33) (actual time=5.422..5.423 rows=6,769 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 502kB
21. 3.292 3.292 ↑ 1.0 6,769 1

Seq Scan on c_bpartner bp (cost=0.00..445.69 rows=6,769 width=33) (actual time=0.003..3.292 rows=6,769 loops=1)

22. 0.176 0.361 ↑ 1.0 647 1

Hash (cost=25.47..25.47 rows=647 width=43) (actual time=0.361..0.361 rows=647 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 57kB
23. 0.185 0.185 ↑ 1.0 647 1

Seq Scan on c_elementvalue ev (cost=0.00..25.47 rows=647 width=43) (actual time=0.008..0.185 rows=647 loops=1)

24. 0.168 0.303 ↑ 1.0 647 1

Hash (cost=25.47..25.47 rows=647 width=43) (actual time=0.303..0.303 rows=647 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 57kB
25. 0.135 0.135 ↑ 1.0 647 1

Seq Scan on c_elementvalue eev (cost=0.00..25.47 rows=647 width=43) (actual time=0.002..0.135 rows=647 loops=1)

26.          

SubPlan (forResult)

27. 25.865 124.135 ↑ 1.0 1 5

Aggregate (cost=8,233.64..8,233.65 rows=1 width=32) (actual time=24.827..24.827 rows=1 loops=5)

28. 9.960 98.270 ↓ 2.0 15,551 5

Nested Loop (cost=172.64..8,194.58 rows=7,812 width=8) (actual time=6.160..19.654 rows=15,551 loops=5)

29. 0.060 0.060 ↑ 1.0 1 5

Seq Scan on ad_org o_2 (cost=0.00..1.04 rows=1 width=5) (actual time=0.008..0.012 rows=1 loops=5)

  • Filter: (ad_org_id = '5000000'::numeric)
  • Rows Removed by Filter: 2
30. 30.825 88.250 ↓ 2.0 15,551 5

Nested Loop (cost=172.64..8,115.42 rows=7,812 width=13) (actual time=6.151..17.650 rows=15,551 loops=5)

31. 0.035 0.130 ↑ 1.0 1 5

Nested Loop (cost=0.28..3.54 rows=1 width=6) (actual time=0.021..0.026 rows=1 loops=5)

  • Join Filter: (ev_2.c_element_id = e_1.c_element_id)
32. 0.085 0.085 ↑ 1.0 1 5

Index Scan using c_elementvalue_pkey on c_elementvalue ev_2 (cost=0.28..2.49 rows=1 width=11) (actual time=0.013..0.017 rows=1 loops=5)

  • Index Cond: (c_elementvalue_id = ev.c_elementvalue_id)
33. 0.010 0.010 ↑ 2.0 1 5

Seq Scan on c_element e_1 (cost=0.00..1.02 rows=2 width=13) (actual time=0.002..0.002 rows=1 loops=5)

34. 27.815 57.295 ↓ 2.0 15,551 5

Bitmap Heap Scan on fact_acct f_1 (cost=172.36..8,033.77 rows=7,812 width=47) (actual time=6.122..11.459 rows=15,551 loops=5)

  • Recheck Cond: ((account_id = ev.c_elementvalue_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=7835
35. 29.480 29.480 ↓ 2.0 15,551 5

Bitmap Index Scan on idx_fact_acct_account_dateacct_org_acctschema (cost=0.00..170.41 rows=7,812 width=0) (actual time=5.896..5.896 rows=15,551 loops=5)

  • Index Cond: ((account_id = ev.c_elementvalue_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))