explain.depesz.com

PostgreSQL's explain analyze made readable

Result: r41w

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 25.142 ↑ 1.0 10 1

Limit (cost=12,703.52..12,703.55 rows=10 width=381) (actual time=25.136..25.142 rows=10 loops=1)

  • 39) AND (id_customer = tb_dist_operation_application.id_customer))
  • (tb_dist_operation_withdraw_request.id_dist_operation_withdraw = tb_dist_operation_withdraw.id_dist_operation_withdraw))
  • time=0.004..0.004 rows=0 loops=1)
2. 1.480 25.139 ↑ 134.6 10 1

Sort (cost=12,703.52..12,706.89 rows=1,346 width=381) (actual time=25.135..25.139 rows=10 loops=1)

  • Sort Key: tb_dist_operation_application.id_dist_operation_application DESC
  • Sort Method: top-N heapsort Memory: 28kB
3. 8.554 23.659 ↑ 1.3 1,018 1

Append (cost=45.87..12,674.43 rows=1,346 width=381) (actual time=1.025..23.659 rows=1,018 loops=1)

4. 4.943 15.105 ↑ 1.1 627 1

Nested Loop Left Join (cost=45.87..6,926.33 rows=704 width=380) (actual time=1.024..15.105 rows=627 loops=1)

  • Join Filter: ((tb_dist_operation_application_pendencies.id_contract = tb_dist_operation_application.id_contract) AND (tb_dist_operation_application_pendencies.id_dist_operation_application = tb_dist_operation_application.id_dist_operation_application) AND (tb_dist_operation_application_pendencies.id_pendency = tb_dist_operation_application.id_pendency))
  • Rows Removed by Join Filter: 6,269
5. 1.338 10.162 ↑ 1.1 627 1

Nested Loop Left Join (cost=45.87..6,844.72 rows=704 width=244) (actual time=0.978..10.162 rows=627 loops=1)

  • Join Filter: ((tb_dist_fund_dac.id_contract = tb_dist_fund_selected.id_contract) AND (tb_dist_fund_dac.id_dac = tb_dist_fund_selected.id_dac))
  • Rows Removed by Join Filter: 1,881
6. 0.497 8.824 ↑ 1.1 627 1

Hash Left Join (cost=45.87..6,831.34 rows=704 width=216) (actual time=0.959..8.824 rows=627 loops=1)

  • Hash Cond: (tb_dist_operation_application.id_status_order = dm_dist_operation_status.id_status_order)
7. 0.489 8.327 ↑ 1.1 627 1

Hash Left Join (cost=44.42..6,820.21 rows=704 width=184) (actual time=0.912..8.327 rows=627 loops=1)

  • Hash Cond: ((tb_dist_operation_application.cd_operation_type)::text = (dm_dist_operation_type.cd_operation_type)::text)
8. 0.805 7.838 ↑ 1.1 627 1

Hash Left Join (cost=43.13..6,809.24 rows=704 width=152) (actual time=0.869..7.838 rows=627 loops=1)

  • Hash Cond: ((tb_dist_operation_application.id_contract = tb_dist_fund_selected.id_contract) AND (tb_dist_operation_application.id_instrument = tb_dist_fund_selected.id_instrument))
9. 5.473 7.033 ↑ 1.1 627 1

Nested Loop Left Join (cost=19.40..6,773.19 rows=704 width=102) (actual time=0.508..7.033 rows=627 loops=1)

  • -> Hash Left Join (cost=18.98..1124.87 rows=704 width=72) (actual time=0.485..2.169 rows=627loops=1)
  • Hash Cond: ((tb_dist_operation_application.id_contract = tb_dist_customer_account.id_contract) AND (tb_dist_operation_application.id_manager = tb_dist_customer_account.id_manager) AND (tb_dist_operation_application.id_customer = tb_dist_customer_account.id_customer) AND (tb_dist_operation_application.cd_account = tb_dist_customer_account.cd_account_sinacor))
  • -> Index Scan using tb_core_customer_data_pk on tb_core_customer_data (cost=0.42..8.01 rows=1
10. 1.197 1.197 ↑ 1.1 627 1

Index Scan using tb_dist_operation_application_search_idx on tb_dist_operation_application (cost=0.29..1,092.09 rows=704 width=67) (actual time=0.095..1.197 rows=627 loops=1)

  • Index Cond: ((id_contract = 39) AND (id_status_order = ANY ('{0,1,2,3,7,17,18,19,20,21,22,23,24,25,26}'::integer[])))
11. 0.203 0.363 ↓ 1.0 453 1

Hash (cost=9.65..9.65 rows=452 width=25) (actual time=0.363..0.363 rows=453 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
12. 0.160 0.160 ↓ 1.0 453 1

Seq Scan on tb_dist_customer_account (cost=0.00..9.65 rows=452 width=25) (actual time=0.017..0.160 rows=453 loops=1)

  • Filter: (id_contract = 39)
13. 0.000 4.389 ↓ 0.0 1 627

width=38) (cost=0..0 rows=0 width=0) (actual time=0.006..0.007 rows=1 loops=627)

  • Index Cond: ((tb_dist_operation_application.id_contract = id_contract) AND (id_contract =
14. 0.091 0.330 ↑ 1.0 172 1

Hash (cost=21.15..21.15 rows=172 width=54) (actual time=0.330..0.330 rows=172 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 23kB
15. 0.239 0.239 ↑ 1.0 172 1

Seq Scan on tb_dist_fund_selected (cost=0.00..21.15 rows=172 width=54) (actual time=0.012..0.239 rows=172 loops=1)

  • Filter: (id_contract = 39)
16. 0.022 0.022 ↑ 1.0 13 1

Hash (cost=1.13..1.13 rows=13 width=64) (actual time=0.022..0.022 rows=13 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
  • -> Seq Scan on dm_dist_operation_type (cost=0.00..1.13 rows=13 width=64) (actual time=0.008..0.010rows=13 loops=1)
17. 0.019 0.030 ↓ 1.3 26 1

Hash (cost=1.20..1.20 rows=20 width=36) (actual time=0.030..0.030 rows=26 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
18. 0.011 0.011 ↓ 1.3 26 1

Seq Scan on dm_dist_operation_status (cost=0.00..1.20 rows=20 width=36) (actual time=0.007..0.011 rows=26 loops=1)

19. 0.000 0.000 ↓ 4.0 4 627

Materialize (cost=0.00..1.05 rows=1 width=44) (actual time=0.000..0.000 rows=4 loops=627)

20. 0.009 0.009 ↓ 4.0 4 1

Seq Scan on tb_dist_fund_dac (cost=0.00..1.05 rows=1 width=44) (actual time=0.007..0.009 rows=4 loops=1)

  • Filter: (id_contract = 39)
21. 0.627 0.627 ↓ 2.5 10 627

Materialize (cost=0.00..20.02 rows=4 width=42) (actual time=0.000..0.001 rows=10 loops=627)

  • -> Seq Scan on tb_dist_operation_application_pendencies (cost=0.00..20.00 rows=4 width=42) (actual time=0.006..0.009rows=10 loops=1)
  • Filter: (id_contract = 39)
22. 2.011 8.359 ↑ 1.6 391 1

Nested Loop Left Join (cost=109.66..5,734.65 rows=642 width=381) (actual time=1.011..8.359 rows=391 loops=1)

  • Join Filter: ((tb_dist_operation_withdraw_pendencies.id_contract = tb_dist_operation_withdraw.id_contract) AND (tb_dist_operation_withdraw_pendencies.id_dist_operation_withdraw = tb_dist_operation_withdraw.id_dist_operation_withdraw) AND (tb_dist_operation_withdraw_pendencies.id_pendency = tb_dist_operation_withdraw.id_pendency))
23. 0.315 6.348 ↑ 1.6 391 1

Hash Left Join (cost=109.66..5,658.46 rows=642 width=246) (actual time=0.988..6.348 rows=391 loops=1)

  • Hash Cond: ((tb_dist_fund_selected_1.id_contract = tb_dist_fund_dac_1.id_contract) AND (tb_dist_fund_selected_1.id_dac= tb_dist_fund_dac_1.id_dac))
24. 0.590 6.033 ↑ 1.6 391 1

Hash Left Join (cost=108.60..5,651.03 rows=642 width=218) (actual time=0.946..6.033 rows=391 loops=1)

  • Hash Cond: ((tb_dist_operation_withdraw.id_contract = tb_dist_customer_account_1.id_contract) AND (tb_dist_operation_withdraw.id_manager = tb_dist_customer_account_1.id_manager) AND (tb_dist_operation_withdraw.id_customer = tb_dist_customer_account_1.id_customer) AND (tb_dist_operation_withdraw.cd_account = tb_dist_customer_account_1.cd_account_sinacor))
25. 0.294 5.443 ↑ 1.6 391 1

Nested Loop Left Join (cost=89.91..5,619.49 rows=642 width=217) (actual time=0.593..5.443 rows=391 loops=1)

  • Join Filter: ((tb_dist_operation_withdraw.id_contract = tb_dist_operation_withdraw_request.id_contract) AND
26. 3.334 5.149 ↑ 1.6 391 1

Nested Loop Left Join (cost=85.74..5,582.38 rows=642 width=217) (actual time=0.581..5.149 rows=391 loops=1)

27. 0.498 1.815 ↑ 1.6 391 1

Hash Left Join (cost=85.32..406.27 rows=642 width=183) (actual time=0.567..1.815 rows=391 loops=1)

  • Hash Cond: ((tb_dist_operation_withdraw.id_contract = tb_dist_fund_selected_1.id_contract) AND(tb_dist_operation_withdraw.id_instrument = tb_dist_fund_selected_1.id_instrument))
  • -> Hash Left Join (cost=61.59..371.31 rows=642 width=133) (actual time=0.262..1.268 rows=391loops=1)
  • Hash Cond: (tb_dist_operation_withdraw.id_status_order = dm_dist_operation_status_1.id_status_order)
28. 0.485 1.011 ↑ 1.6 391 1

Hash Left Join (cost=60.14..361.03 rows=642 width=101) (actual time=0.214..1.011 rows=391 loops=1)

  • Hash Cond: ((tb_dist_operation_withdraw.cd_operation_type)::text = (dm_dist_operation_type_1.cd_operation_type)::text)
29. 0.363 0.494 ↑ 1.6 391 1

Bitmap Heap Scan on tb_dist_operation_withdraw (cost=58.85..350.91 rows=642 width=69) (actual time=0.154..0.494 rows=391 loops=1)

  • Recheck Cond: ((id_contract = 39) AND (id_status_order = ANY ('{0,1,2,3,7,17,18,19,20,21,22,23,24,25,26}'::integer[])))
  • Heap Blocks: exact=94
30. 0.131 0.131 ↑ 1.4 455 1

Bitmap Index Scan on tb_dist_operation_withdraw_id_contract_id_status_order_idx (cost=0.00..58.69 rows=642 width=0) (actual time=0.131..0.131 rows=455 loops=1)

  • Index Cond: ((id_contract = 39) AND (id_status_order = ANY ('{0,1,2,3,7,17,18,19,20,21,22,23,24,25,26}'::integer[])))
31. 0.020 0.032 ↑ 1.0 13 1

Hash (cost=1.13..1.13 rows=13 width=64) (actual time=0.032..0.032 rows=13 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
32. 0.012 0.012 ↑ 1.0 13 1

Seq Scan on dm_dist_operation_type dm_dist_operation_type_1 (cost=0.00..1.13 rows=13 width=64) (actual time=0.008..0.012 rows=13 loops=1)

33. 0.013 0.022 ↓ 1.3 26 1

Hash (cost=1.20..1.20 rows=20 width=36) (actual time=0.022..0.022 rows=26 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
34. 0.009 0.009 ↓ 1.3 26 1

Seq Scan on dm_dist_operation_status dm_dist_operation_status_1 (cost=0.00..1.20 rows=20 width=36) (actual time=0.006..0.009 rows=26 loops=1)

35. 0.284 0.284 ↑ 1.0 172 1

Hash (cost=21.15..21.15 rows=172 width=54) (actual time=0.284..0.284 rows=172 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 23kB
  • -> Seq Scan on tb_dist_fund_selected tb_dist_fund_selected_1 (cost=0.00..21.15 rows=172
36. 0.000 0.199 ↓ 0.0 172 1

width=54) (cost=0..0 rows=0 width=0) (actual time=0.008..0.199 rows=172 loops=1)

  • Filter: (id_contract = 39)
37. 2.737 2.737 ↑ 1.0 1 391

Index Scan using tb_core_customer_data_pk on tb_core_customer_data tb_core_customer_data_1 (cost=0.42..8.05 rows=1 width=38) (actual time=0.007..0.007 rows=1 loops=391)

  • Index Cond: ((tb_dist_operation_withdraw.id_contract = id_contract) AND (id_contract = 39) AND(id_customer = tb_dist_operation_withdraw.id_customer))
38. 0.000 0.000 ↓ 0.0 0 391

Materialize (cost=4.16..25.88 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=391)

  • -> Bitmap Heap Scan on tb_dist_operation_withdraw_request (cost=4.16..25.87 rows=1 width=8) (actual
  • Recheck Cond: (id_contract = 39)
  • Filter: (seq = (SubPlan 2))
39. 0.003 0.003 ↓ 0.0 0 1

Bitmap Index Scan on tb_dist_operation_withdraw_request_pk (cost=0.00..4.16 rows=2 width=0) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: (id_contract = 39)
40.          

SubPlan (for Materialize)

41. 0.000 0.000 ↓ 0.0 0

Result (cost=8.17..8.18 rows=1 width=4) (never executed)

42.          

Initplan (for Result)

43. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.15..8.17 rows=1 width=4) (never executed)

44. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using tb_dist_operation_withdraw_request_pk on tb_dist_operation_withdraw_request inner_request (cost=0.15..8.17 rows=1 width=4) (never executed)

  • Index Cond: ((id_contract = tb_dist_operation_withdraw_request.id_contract) AND (id_dist_operation_withdraw = tb_dist_operation_withdraw_request.id_dist_operation_withdraw) AND (seq IS NOT NULL))
  • Filter: ((cd_status)::text <> 'PENDENT'::text)
45. 0.183 0.323 ↓ 1.0 453 1

Hash (cost=9.65..9.65 rows=452 width=25) (actual time=0.323..0.323 rows=453 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
46. 0.140 0.140 ↓ 1.0 453 1

Seq Scan on tb_dist_customer_account tb_dist_customer_account_1 (cost=0.00..9.65 rows=452 width=25) (actual time=0.010..0.140 rows=453 loops=1)

  • Filter: (id_contract = 39)
47. 0.022 0.022 ↓ 4.0 4 1

Hash (cost=1.05..1.05 rows=1 width=44) (actual time=0.022..0.022 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • -> Seq Scan on tb_dist_fund_dac tb_dist_fund_dac_1 (cost=0.00..1.05 rows=1 width=44) (actual time=0.006..0.009rows=4 loops=1)
  • Filter: (id_contract = 39)
48. 0.000 0.000 ↓ 0.0 0 391

Materialize (cost=0.00..20.02 rows=4 width=42) (actual time=0.000..0.000 rows=0 loops=391)

49. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on tb_dist_operation_withdraw_pendencies (cost=0.00..20.00 rows=4 width=42) (actual time=0.003..0.003 rows=0 loops=1)

  • Filter: (id_contract = 39)
Planning time : 13.619 ms
Execution time : 26.047 ms