explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3EH

Settings
# exclusive inclusive rows x rows loops node
1. 0.029 9,109.785 ↑ 1.0 200 1

Limit (cost=7,806.83..9,520.33 rows=200 width=997) (actual time=9,010.923..9,109.785 rows=200 loops=1)

2. 0.353 9,109.756 ↑ 12.4 200 1

Result (cost=7,806.83..29,028.53 rows=2,477 width=997) (actual time=9,010.922..9,109.756 rows=200 loops=1)

3. 33.453 9,010.003 ↑ 12.4 200 1

Sort (cost=7,806.83..7,813.03 rows=2,477 width=469) (actual time=9,009.962..9,010.003 rows=200 loops=1)

  • Sort Key: (COALESCE(statementread.acquitdate, statementread.duedate)), statementread.creationdate, statementread.id
  • Sort Method: top-N heapsort Memory: 189kB
4. 12.861 8,976.550 ↓ 7.2 17,873 1

Hash Left Join (cost=713.28..7,699.78 rows=2,477 width=469) (actual time=305.239..8,976.550 rows=17,873 loops=1)

  • Hash Cond: (statementread.financialnature_id = naturezafinanceiraread.id_natureza_financeira)
5. 7.732 8,954.361 ↓ 7.2 17,873 1

Hash Left Join (cost=454.76..7,422.37 rows=2,477 width=413) (actual time=295.886..8,954.361 rows=17,873 loops=1)

  • Hash Cond: (statementread.bank_id = bankread.id_banco)
6. 16.888 8,944.978 ↓ 7.2 17,873 1

Nested Loop Anti Join (cost=451.93..7,413.04 rows=2,477 width=376) (actual time=294.219..8,944.978 rows=17,873 loops=1)

7. 5.050 1,350.780 ↓ 7.5 19,429 1

Hash Left Join (cost=451.23..2,189.55 rows=2,600 width=376) (actual time=294.192..1,350.780 rows=19,429 loops=1)

  • Hash Cond: (statementread.costcenter_id = centrocustoread.id_centro_custo)
8. 10.190 1,345.700 ↓ 7.5 19,429 1

Hash Left Join (cost=444.84..2,176.33 rows=2,600 width=361) (actual time=294.143..1,345.700 rows=19,429 loops=1)

  • Hash Cond: (statementread.contact_id = pessoaread.id_pessoa)
9. 13.593 1,093.258 ↓ 7.5 19,429 1

Hash Left Join (cost=176.98..1,901.65 rows=2,600 width=323) (actual time=51.840..1,093.258 rows=19,429 loops=1)

  • Hash Cond: (statementread.id = attachmentsummary.statement_id)
10. 1,029.004 1,029.004 ↓ 7.5 19,429 1

Index Scan using idx_stmt_state_tenant_type on statement statementread (cost=0.57..1,718.41 rows=2,600 width=309) (actual time=1.164..1,029.004 rows=19,429 loops=1)

  • Index Cond: ((company_id = '1233694'::bigint) AND ((type)::text = 'RECEIVABLE'::text))
11. 0.353 50.661 ↓ 4.3 1,455 1

Hash (cost=172.18..172.18 rows=338 width=22) (actual time=50.661..50.661 rows=1,455 loops=1)

  • Buckets: 2,048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 96kB
12. 50.308 50.308 ↓ 4.3 1,455 1

Index Scan using idx_atach_tenant_stmt_not_null on attachmentsummary (cost=0.43..172.18 rows=338 width=22) (actual time=0.409..50.308 rows=1,455 loops=1)

  • Index Cond: (tenant_id = '1233694'::bigint)
13. 1.316 242.252 ↓ 8.6 4,266 1

Hash (cost=261.64..261.64 rows=498 width=46) (actual time=242.252..242.252 rows=4,266 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 409kB
14. 240.936 240.936 ↓ 8.6 4,266 1

Index Scan using idx_tenant_tipo on ef_pessoa pessoaread (cost=0.57..261.64 rows=498 width=46) (actual time=0.428..240.936 rows=4,266 loops=1)

  • Index Cond: (empresa_id_empresa = '1233694'::bigint)
15. 0.005 0.030 ↑ 3.3 9 1

Hash (cost=6.02..6.02 rows=30 width=23) (actual time=0.029..0.030 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
16. 0.025 0.025 ↑ 3.3 9 1

Index Scan using idx_cent_id_empresa_136 on ef_centro_custo centrocustoread (cost=0.43..6.02 rows=30 width=23) (actual time=0.024..0.025 rows=9 loops=1)

  • Index Cond: (id_empresa = '1233694'::bigint)
17. 7,577.310 7,577.310 ↓ 0.0 0 19,429

Index Only Scan using idx_statementexternalreference_statement_id_type_value on statementexternalreference (cost=0.70..2.01 rows=1 width=8) (actual time=0.390..0.390 rows=0 loops=19,429)

  • Index Cond: (statement_id = statementread.id)
  • Filter: ((type)::text = ANY ('{TRANSFER,INITIAL_BALANCE}'::text[]))
  • Rows Removed by Filter: 1
  • Heap Fetches: 3,295
18. 0.009 1.651 ↓ 7.0 14 1

Hash (cost=2.81..2.81 rows=2 width=45) (actual time=1.651..1.651 rows=14 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
19. 1.642 1.642 ↓ 7.0 14 1

Index Scan using idx_ban_id_empresa on ef_banco bankread (cost=0.43..2.81 rows=2 width=45) (actual time=1.046..1.642 rows=14 loops=1)

  • Index Cond: (id_empresa = '1233694'::bigint)
20. 0.035 9.328 ↑ 4.0 123 1

Hash (cost=252.42..252.42 rows=488 width=44) (actual time=9.328..9.328 rows=123 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
21. 9.293 9.293 ↑ 4.0 123 1

Index Scan using idx1_natureza_financeira on ef_natureza_financeira naturezafinanceiraread (cost=0.57..252.42 rows=488 width=44) (actual time=8.479..9.293 rows=123 loops=1)

  • Index Cond: (id_empresa = '1233694'::bigint)
22.          

SubPlan (for Result)

23. 98.200 98.200 ↑ 1.0 1 200

Index Scan using recurrentstatement_pkey on recurrentstatement (cost=0.57..2.79 rows=1 width=7) (actual time=0.491..0.491 rows=1 loops=200)

  • Index Cond: (id = statementread.recurrentstatement_id)
24. 0.400 0.400 ↑ 1.0 1 200

Index Scan using recurrentstatement_pkey on recurrentstatement recurrentstatement_1 (cost=0.57..2.79 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=200)

  • Index Cond: (id = statementread.recurrentstatement_id)
25. 0.000 0.800 ↑ 1.0 1 200

Aggregate (cost=2.97..2.98 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=200)

26. 0.800 0.800 ↓ 0.0 0 200

Index Only Scan using idx_statementexternalreference_statement_id_type_value on statementexternalreference statementexternalreference_1 (cost=0.70..2.93 rows=2 width=12) (actual time=0.004..0.004 rows=0 loops=200)

  • Index Cond: (statement_id = statementread.id)
  • Heap Fetches: 0
Planning time : 7.574 ms
Execution time : 9,110.070 ms