explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GKyx

Settings
# exclusive inclusive rows x rows loops node
1. 0.033 427.209 ↑ 1.0 5 1

Limit (cost=17,141.55..67,484.52 rows=5 width=436) (actual time=327.809..427.209 rows=5 loops=1)

2. 0.051 427.176 ↑ 9,848.6 5 1

Result (cost=17,141.55..495,824,862.22 rows=49,243 width=436) (actual time=327.806..427.176 rows=5 loops=1)

3. 38.315 291.495 ↑ 9,848.6 5 1

Sort (cost=17,141.55..17,264.66 rows=49,243 width=410) (actual time=291.488..291.495 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. 59.835 253.180 ↑ 1.0 47,628 1

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

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

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

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

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

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

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

8. 0.003 0.051 ↑ 1.0 1 1

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

9. 0.022 0.022 ↑ 1.0 1 1

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

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

Seq Scan on ad_orginfo oi (cost=0.00..1.04 rows=1 width=24) (actual time=0.023..0.026 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. 21.467 122.106 ↑ 1.0 47,628 1

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

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

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

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

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

14. 0.011 0.011 ↑ 1.0 1 1

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

  • Filter: (ad_org_id = '5000000'::numeric)
  • Rows Removed by Filter: 2
15. 59.508 59.508 ↑ 1.0 47,628 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.039..59.508 rows=47,628 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))
16. 0.387 0.997 ↑ 1.0 647 1

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

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

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

18. 0.013 0.018 ↑ 1.0 2 1

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

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

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

20. 3.267 10.988 ↑ 1.0 6,769 1

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

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

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

22. 0.321 0.633 ↑ 1.0 647 1

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

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

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

24. 0.321 0.556 ↑ 1.0 647 1

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

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

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

26.          

SubPlan (forResult)

27. 23.275 135.630 ↑ 1.0 1 5

Aggregate (cost=10,068.55..10,068.56 rows=1 width=32) (actual time=27.126..27.126 rows=1 loops=5)

28. 9.115 112.355 ↓ 2.0 15,551 5

Nested Loop (cost=107.67..10,029.49 rows=7,812 width=8) (actual time=2.369..22.471 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.007..0.012 rows=1 loops=5)

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

Nested Loop (cost=107.67..9,950.33 rows=7,812 width=13) (actual time=2.360..20.636 rows=15,551 loops=5)

31. 0.035 0.145 ↑ 1.0 1 5

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

  • Join Filter: (ev_2.c_element_id = e_1.c_element_id)
32. 0.090 0.090 ↑ 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.015..0.018 rows=1 loops=5)

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

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

34. 74.215 84.310 ↓ 2.0 15,551 5

Bitmap Heap Scan on fact_acct f_1 (cost=107.39..9,868.67 rows=7,812 width=47) (actual time=2.326..16.862 rows=15,551 loops=5)

  • Recheck Cond: (account_id = ev.c_elementvalue_id)
  • Filter: ((ad_org_id = '5000000'::numeric) AND (c_acctschema_id = '5000000'::numeric) AND ((dateacct)::date < '2018-07-06'::date))
  • Rows Removed by Filter: 3370
  • Heap Blocks: exact=9725
35. 10.095 10.095 ↓ 1.9 18,921 5

Bitmap Index Scan on idx_fact_acct_account_id (cost=0.00..105.44 rows=9,895 width=0) (actual time=2.019..2.019 rows=18,921 loops=5)

  • Index Cond: (account_id = ev.c_elementvalue_id)