explain.depesz.com

PostgreSQL's explain analyze made readable

Result: K0h

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

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

2. 0.002 9.592 ↓ 0.0 0 1

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

3. 0.001 0.039 ↓ 0.0 0 1

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

4. 0.028 0.038 ↓ 0.0 0 1

Sort (cost=10.19..10.20 rows=1 width=208) (actual time=0.038..0.038 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.010 ↓ 0.0 0 1

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

6. 0.001 0.010 ↓ 0.0 0 1

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

7. 0.009 0.009 ↓ 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.009..0.009 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.013 0.024 ↓ 0.0 0 1

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

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

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

12. 0.000 0.011 ↓ 0.0 0 1

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

13. 0.011 0.011 ↓ 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.011..0.011 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.001 0.009 ↓ 0.0 0 1

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

17. 0.004 0.008 ↓ 0.0 0 1

Sort (cost=10.18..10.19 rows=1 width=208) (actual time=0.008..0.008 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.000 0.004 ↓ 0.0 0 1

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

19. 0.000 0.004 ↓ 0.0 0 1

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

20. 0.004 0.004 ↓ 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.004..0.004 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.001 0.011 ↓ 0.0 0 1

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

24. 0.005 0.010 ↓ 0.0 0 1

Sort (cost=10.18..10.18 rows=1 width=208) (actual time=0.010..0.010 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.000 0.005 ↓ 0.0 0 1

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

26. 0.000 0.005 ↓ 0.0 0 1

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

27. 0.005 0.005 ↓ 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.005..0.005 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.008 8.969 ↓ 0.0 0 1

Sort (cost=7,278.69..7,278.70 rows=1 width=200) (actual time=8.969..8.969 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.000 8.961 ↓ 0.0 0 1

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

32. 0.611 8.961 ↓ 0.0 0 1

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

33. 0.773 7.107 ↓ 1.5 1,243 1

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

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

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

35. 0.005 0.243 ↑ 1.0 17 1

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

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

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

  • Filter: (ade_cd_gestora = 2)
  • Rows Removed by Filter: 280
37. 1.243 1.243 ↓ 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.001..0.001 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.000 0.482 ↓ 0.0 0 1

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

40. 0.039 0.482 ↓ 0.0 0 1

Sort (cost=805.41..805.80 rows=155 width=209) (actual time=0.482..0.482 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.000 0.443 ↓ 0.0 0 1

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

42. 0.000 0.443 ↓ 0.0 0 1

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

43. 0.443 0.443 ↓ 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.442..0.443 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.001 0.036 ↓ 0.0 0 1

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

47. 0.024 0.035 ↓ 0.0 0 1

Sort (cost=29,515.97..29,516.00 rows=10 width=204) (actual time=0.035..0.035 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.004 0.010 ↓ 0.0 0 1

Sort (cost=501.12..501.13 rows=1 width=200) (actual time=0.010..0.010 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.000 0.006 ↓ 0.0 0 1

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

55. 0.001 0.006 ↓ 0.0 0 1

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

56. 0.005 0.005 ↓ 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.005..0.005 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.005 0.010 ↓ 0.0 0 1

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

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

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

61. 0.001 0.005 ↓ 0.0 0 1

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

62. 0.004 0.004 ↓ 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.004..0.004 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.458 ms
Execution time : 10.495 ms