explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SfH2

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 24.777 ↓ 0.0 0 1

Limit (cost=10.19..231.97 rows=1 width=200) (actual time=24.777..24.777 rows=0 loops=1)

2. 0.004 24.775 ↓ 0.0 0 1

Append (cost=10.19..38,155.14 rows=172 width=200) (actual time=24.775..24.775 rows=0 loops=1)

3. 0.001 0.047 ↓ 0.0 0 1

Subquery Scan on x (cost=10.19..10.21 rows=1 width=200) (actual time=0.047..0.047 rows=0 loops=1)

4. 0.019 0.046 ↓ 0.0 0 1

Sort (cost=10.19..10.20 rows=1 width=208) (actual time=0.046..0.046 rows=0 loops=1)

  • Sort Key: (abs((car.car_dt_bom_para - '2020-07-06'::date))), car.car_cd_parcelamento
  • Sort Method: quicksort Memory: 25kB
5. 0.000 0.027 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1.27..10.18 rows=1 width=208) (actual time=0.027..0.027 rows=0 loops=1)

6. 0.001 0.027 ↓ 0.0 0 1

Nested Loop (cost=0.85..5.31 rows=1 width=179) (actual time=0.027..0.027 rows=0 loops=1)

7. 0.026 0.026 ↓ 0.0 0 1

Index Scan using cartao_idx_filial_aut_valor_dt_adm on cartao car (cost=0.56..2.80 rows=1 width=163) (actual time=0.026..0.026 rows=0 loops=1)

  • Index Cond: ((car_cd_unidade_negocio = 332) AND ((car_ds_autorizacao)::text = '621942'::text) AND (car_vl_cartao >= 226.98::numeric(18,2)) AND (car_vl_cartao <= 227.02::numeric(18,2)) AND (car_dt_movimento = '2020-06-05'::date) AND (car_cd_administradora = 7,870))
  • Filter: (car_cd_cartao <> '-1'::integer)
8. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm (cost=0.29..2.50 rows=1 width=20) (never executed)

  • Index Cond: (adm_cd_administradora = 7,870)
9. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
10. 0.038 0.057 ↓ 0.0 0 1

Sort (cost=10.19..10.19 rows=1 width=200) (actual time=0.057..0.057 rows=0 loops=1)

  • Sort Key: car_1.car_dt_bom_para
  • Sort Method: quicksort Memory: 25kB
11. 0.000 0.019 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1.27..10.18 rows=1 width=200) (actual time=0.019..0.019 rows=0 loops=1)

12. 0.000 0.019 ↓ 0.0 0 1

Nested Loop (cost=0.85..5.30 rows=1 width=175) (actual time=0.019..0.019 rows=0 loops=1)

13. 0.019 0.019 ↓ 0.0 0 1

Index Scan using cartao_idx_filial_adm_dt_valor_aut on cartao car_1 (cost=0.56..2.79 rows=1 width=159) (actual time=0.019..0.019 rows=0 loops=1)

  • Index Cond: ((car_cd_unidade_negocio = 332) AND (car_cd_administradora = 7,870) AND (car_dt_movimento = '2020-06-05'::date) AND (car_vl_cartao = 227.0))
  • Filter: (((car_ds_autorizacao)::text ~~* '%621942%'::text) AND (car_cd_cartao <> '-1'::integer))
14. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm_1 (cost=0.29..2.50 rows=1 width=20) (never executed)

  • Index Cond: (adm_cd_administradora = 7,870)
15. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi cartao_edi_1 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_1.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
16. 0.000 0.020 ↓ 0.0 0 1

Subquery Scan on x_1 (cost=10.18..10.20 rows=1 width=200) (actual time=0.020..0.020 rows=0 loops=1)

17. 0.007 0.020 ↓ 0.0 0 1

Sort (cost=10.18..10.19 rows=1 width=208) (actual time=0.020..0.020 rows=0 loops=1)

  • Sort Key: (abs((car_2.car_dt_bom_para - '2020-07-06'::date))), car_2.car_cd_parcelamento
  • Sort Method: quicksort Memory: 25kB
18. 0.001 0.013 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1.27..10.17 rows=1 width=208) (actual time=0.012..0.013 rows=0 loops=1)

19. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=0.85..5.30 rows=1 width=179) (actual time=0.012..0.012 rows=0 loops=1)

20. 0.012 0.012 ↓ 0.0 0 1

Index Scan using cartao_idx_filial_aut_valor_dt_adm on cartao car_2 (cost=0.56..2.79 rows=1 width=163) (actual time=0.012..0.012 rows=0 loops=1)

  • Index Cond: ((car_cd_unidade_negocio = 332) AND ((car_ds_autorizacao)::text = '621942'::text) AND (car_vl_cartao >= 226.98::numeric(18,2)) AND (car_vl_cartao <= 227.02::numeric(18,2)) AND (car_dt_movimento = '2020-06-05'::date))
  • Filter: (car_cd_cartao <> '-1'::integer)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm_2 (cost=0.29..2.50 rows=1 width=20) (never executed)

  • Index Cond: (adm_cd_administradora = car_2.car_cd_administradora)
22. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi cartao_edi_2 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_2.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
23. 0.000 0.018 ↓ 0.0 0 1

Subquery Scan on x_2 (cost=10.18..10.19 rows=1 width=200) (actual time=0.018..0.018 rows=0 loops=1)

24. 0.007 0.018 ↓ 0.0 0 1

Sort (cost=10.18..10.18 rows=1 width=208) (actual time=0.018..0.018 rows=0 loops=1)

  • Sort Key: car_3.car_dt_movimento DESC, (abs((car_3.car_dt_bom_para - '2020-07-06'::date))), car_3.car_cd_parcelamento
  • Sort Method: quicksort Memory: 25kB
25. 0.001 0.011 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1.27..10.17 rows=1 width=208) (actual time=0.010..0.011 rows=0 loops=1)

26. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=0.85..5.29 rows=1 width=179) (actual time=0.010..0.010 rows=0 loops=1)

27. 0.010 0.010 ↓ 0.0 0 1

Index Scan using cartao_idx_filial_aut_valor_dt_adm on cartao car_3 (cost=0.56..2.79 rows=1 width=163) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: ((car_cd_unidade_negocio = 332) AND ((car_ds_autorizacao)::text = '621942'::text) AND (car_vl_cartao >= 226.98::numeric(18,2)) AND (car_vl_cartao <= 227.02::numeric(18,2)))
  • Filter: (car_cd_cartao <> '-1'::integer)
28. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm_3 (cost=0.29..2.50 rows=1 width=20) (never executed)

  • Index Cond: (adm_cd_administradora = car_3.car_cd_administradora)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi cartao_edi_3 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_3.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
30. 0.012 24.469 ↓ 0.0 0 1

Sort (cost=7,278.69..7,278.70 rows=1 width=200) (actual time=24.469..24.469 rows=0 loops=1)

  • Sort Key: car_4.car_dt_movimento DESC, car_4.car_dt_bom_para
  • Sort Method: quicksort Memory: 25kB
31. 0.001 24.457 ↓ 0.0 0 1

Nested Loop Anti Join (cost=7.91..7,278.68 rows=1 width=200) (actual time=24.457..24.457 rows=0 loops=1)

32. 0.785 24.456 ↓ 0.0 0 1

Nested Loop (cost=7.49..7,273.81 rows=1 width=175) (actual time=24.456..24.456 rows=0 loops=1)

33. 1.825 19.942 ↓ 1.5 1,243 1

Hash Join (cost=6.93..513.25 rows=803 width=20) (actual time=7.126..19.942 rows=1,243 loops=1)

  • Hash Cond: (adm_4.adm_cd_administradora_edi = ade.ade_cd_administradora_edi)
34. 17.930 17.930 ↑ 1.0 14,034 1

Seq Scan on administradora adm_4 (cost=0.00..469.34 rows=14,034 width=24) (actual time=6.906..17.930 rows=14,034 loops=1)

35. 0.009 0.187 ↑ 1.0 17 1

Hash (cost=6.71..6.71 rows=17 width=4) (actual time=0.186..0.187 rows=17 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
36. 0.178 0.178 ↑ 1.0 17 1

Seq Scan on administradora_edi ade (cost=0.00..6.71 rows=17 width=4) (actual time=0.015..0.178 rows=17 loops=1)

  • Filter: (ade_cd_gestora = 2)
  • Rows Removed by Filter: 280
37. 3.729 3.729 ↓ 0.0 0 1,243

Index Scan using cartao_idx_filial_adm_dt_valor_aut on cartao car_4 (cost=0.56..8.41 rows=1 width=159) (actual time=0.003..0.003 rows=0 loops=1,243)

  • Index Cond: ((car_cd_unidade_negocio = 332) AND (car_cd_administradora = adm_4.adm_cd_administradora))
  • Filter: (((car_ds_autorizacao)::text ~~* '%621942%'::text) AND (car_cd_cartao <> '-1'::integer))
38. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi cartao_edi_4 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_4.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
39. 0.001 0.051 ↓ 0.0 0 1

Subquery Scan on x_3 (cost=805.41..807.35 rows=155 width=200) (actual time=0.051..0.051 rows=0 loops=1)

40. 0.022 0.050 ↓ 0.0 0 1

Sort (cost=805.41..805.80 rows=155 width=209) (actual time=0.050..0.050 rows=0 loops=1)

  • Sort Key: ((car_5.car_cd_administradora = 7,870)), car_5.car_dt_movimento DESC, (abs((car_5.car_dt_bom_para - '2020-07-06'::date))), car_5.car_cd_parcelamento
  • Sort Method: quicksort Memory: 25kB
41. 0.001 0.028 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1.27..799.78 rows=155 width=209) (actual time=0.028..0.028 rows=0 loops=1)

42. 0.000 0.027 ↓ 0.0 0 1

Nested Loop (cost=0.85..393.39 rows=155 width=179) (actual time=0.027..0.027 rows=0 loops=1)

43. 0.027 0.027 ↓ 0.0 0 1

Index Scan using cartao_idx_autorizacao on cartao car_5 (cost=0.56..162.80 rows=155 width=163) (actual time=0.027..0.027 rows=0 loops=1)

  • Index Cond: ((car_cd_unidade_negocio = 332) AND ((car_ds_autorizacao)::text = '621942'::text))
  • Filter: (car_cd_cartao <> '-1'::integer)
44. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm_5 (cost=0.29..1.49 rows=1 width=20) (never executed)

  • Index Cond: (adm_cd_administradora = car_5.car_cd_administradora)
45. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi cartao_edi_5 (cost=0.42..2.59 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_5.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
46. 0.000 0.071 ↓ 0.0 0 1

Subquery Scan on x_4 (cost=29,515.97..29,516.10 rows=10 width=200) (actual time=0.071..0.071 rows=0 loops=1)

47. 0.060 0.071 ↓ 0.0 0 1

Sort (cost=29,515.97..29,516.00 rows=10 width=204) (actual time=0.071..0.071 rows=0 loops=1)

  • Sort Key: (((car_6.car_ds_autorizacao)::text <-> '621942'::text)), car_6.car_dt_movimento DESC, car_6.car_dt_bom_para
  • Sort Method: quicksort Memory: 25kB
48. 0.000 0.011 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1.27..29,515.80 rows=10 width=204) (actual time=0.011..0.011 rows=0 loops=1)

49. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=0.85..29,487.06 rows=10 width=175) (actual time=0.011..0.011 rows=0 loops=1)

50. 0.010 0.010 ↓ 0.0 0 1

Index Scan using cartao_idx on cartao car_6 (cost=0.56..29,463.13 rows=10 width=159) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: (car_cd_unidade_negocio = 332)
  • Filter: (((car_ds_autorizacao)::text ~~* '%621942%'::text) AND (car_cd_cartao <> '-1'::integer))
51. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm_6 (cost=0.29..2.39 rows=1 width=20) (never executed)

  • Index Cond: (adm_cd_administradora = car_6.car_cd_administradora)
52. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi cartao_edi_6 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_6.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
53. 0.008 0.021 ↓ 0.0 0 1

Sort (cost=501.12..501.13 rows=1 width=200) (actual time=0.020..0.021 rows=0 loops=1)

  • Sort Key: car_7.car_dt_movimento DESC, car_7.car_dt_bom_para
  • Sort Method: quicksort Memory: 25kB
54. 0.001 0.013 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1.27..501.11 rows=1 width=200) (actual time=0.013..0.013 rows=0 loops=1)

55. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=0.85..496.24 rows=1 width=175) (actual time=0.012..0.012 rows=0 loops=1)

56. 0.012 0.012 ↓ 0.0 0 1

Index Scan using cartao_idx_filial_adm_dt_valor_aut on cartao car_7 (cost=0.56..493.74 rows=1 width=159) (actual time=0.012..0.012 rows=0 loops=1)

  • Index Cond: ((car_cd_unidade_negocio = 332) AND (car_vl_cartao = 227.0))
  • Filter: (((car_ds_autorizacao)::text ~~* '%621942%'::text) AND (car_cd_cartao <> '-1'::integer))
57. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm_7 (cost=0.29..2.50 rows=1 width=20) (never executed)

  • Index Cond: (adm_cd_administradora = car_7.car_cd_administradora)
58. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi cartao_edi_7 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_7.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
59. 0.007 0.017 ↓ 0.0 0 1

Sort (cost=10.18..10.19 rows=1 width=200) (actual time=0.017..0.017 rows=0 loops=1)

  • Sort Key: car_8.car_dt_bom_para
  • Sort Method: quicksort Memory: 25kB
60. 0.001 0.010 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1.27..10.17 rows=1 width=200) (actual time=0.010..0.010 rows=0 loops=1)

61. 0.001 0.009 ↓ 0.0 0 1

Nested Loop (cost=0.85..5.30 rows=1 width=175) (actual time=0.009..0.009 rows=0 loops=1)

62. 0.008 0.008 ↓ 0.0 0 1

Index Scan using cartao_idx_filial_adm_dt_valor_aut on cartao car_8 (cost=0.56..2.79 rows=1 width=159) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((car_cd_unidade_negocio = 332) AND (car_cd_administradora = 7,870) AND (car_dt_movimento = '2020-06-05'::date) AND (car_vl_cartao = 227.0))
  • Filter: (car_cd_cartao <> '-1'::integer)
63. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm_8 (cost=0.29..2.50 rows=1 width=20) (never executed)

  • Index Cond: (adm_cd_administradora = 7,870)
64. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi cartao_edi_8 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_8.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
Planning time : 14.312 ms
Execution time : 26.099 ms