explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WPtf

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 0.102 ↑ 1.0 1 1

Limit (cost=10.19..19.70 rows=1 width=200) (actual time=0.102..0.102 rows=1 loops=1)

2. 0.001 0.099 ↑ 3,070.0 1 1

Append (cost=10.19..29,204.29 rows=3,070 width=200) (actual time=0.099..0.099 rows=1 loops=1)

3. 0.002 0.030 ↓ 0.0 0 1

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

4. 0.005 0.028 ↓ 0.0 0 1

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

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

6. 0.000 0.022 ↓ 0.0 0 1

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

7. 0.022 0.022 ↓ 0.0 0 1

Index Scan using cartao_idx_filial_adm_dt_valor_aut on cartao car (cost=0.56..2.80 rows=1 width=163) (actual time=0.022..0.022 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 >= 226.98::numeric(18,2)) AND (car_vl_cartao <= 227.02::numeric(18,2)) AND ((car_ds_autorizacao)::text = '621942'::text))
  • Filter: (car_cd_cartao <> '-1'::integer)
8. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm (cost=0.28..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.003 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_1.car_dt_bom_para
  • Sort Method: quicksort Memory: 25kB
11. 0.000 0.007 ↓ 0.0 0 1

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

12. 0.000 0.007 ↓ 0.0 0 1

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

13. 0.007 0.007 ↓ 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.007..0.007 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.28..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.002 0.058 ↑ 1.0 1 1

Subquery Scan on x_1 (cost=61.50..61.52 rows=1 width=200) (actual time=0.058..0.058 rows=1 loops=1)

17. 0.006 0.056 ↑ 1.0 1 1

Sort (cost=61.50..61.51 rows=1 width=208) (actual time=0.056..0.056 rows=1 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.006 0.050 ↑ 1.0 1 1

Nested Loop Anti Join (cost=1.27..61.49 rows=1 width=208) (actual time=0.049..0.050 rows=1 loops=1)

19. 0.004 0.038 ↑ 1.0 1 1

Nested Loop (cost=0.84..56.62 rows=1 width=179) (actual time=0.037..0.038 rows=1 loops=1)

20. 0.026 0.026 ↑ 1.0 1 1

Index Scan using cartao_idx_autorizacao on cartao car_2 (cost=0.56..54.12 rows=1 width=163) (actual time=0.026..0.026 rows=1 loops=1)

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

Index Scan using administradora_pkey on administradora adm_2 (cost=0.28..2.50 rows=1 width=20) (actual time=0.008..0.008 rows=1 loops=1)

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

Index Scan using cartao_edi_idx_cartao_nao_vinculado on cartao_edi cartao_edi_2 (cost=0.42..2.64 rows=1 width=4) (actual time=0.006..0.006 rows=0 loops=1)

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

Subquery Scan on x_2 (cost=2,988.99..2,989.01 rows=1 width=200) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Sort (cost=2,988.99..2,989.00 rows=1 width=208) (never executed)

  • Sort Key: car_3.car_dt_movimento DESC, (abs((car_3.car_dt_bom_para - '2020-07-06'::date))), car_3.car_cd_parcelamento
25. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=1.27..2,988.98 rows=1 width=208) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..2,984.11 rows=1 width=179) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_idx_autorizacao on cartao car_3 (cost=0.56..2,981.61 rows=1 width=163) (never executed)

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

Index Scan using administradora_pkey on administradora adm_3 (cost=0.28..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.000 0.000 ↓ 0.0 0

Sort (cost=6,622.99..6,623.01 rows=11 width=200) (never executed)

  • Sort Key: car_4.car_dt_movimento DESC, car_4.car_dt_bom_para
31. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=6,142.21..6,622.80 rows=11 width=200) (never executed)

32. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6,141.79..6,592.29 rows=11 width=175) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6,141.64..6,561.33 rows=184 width=179) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on cartao car_4 (cost=6,141.36..6,346.63 rows=184 width=159) (never executed)

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

BitmapAnd (cost=6,141.36..6,141.36 rows=184 width=0) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cartao_gin_autorizacao (cost=0.00..88.74 rows=9,485 width=0) (never executed)

  • Index Cond: ((car_ds_autorizacao)::text ~~* '%621942%'::text)
37. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cartao_idx (cost=0.00..6,052.28 rows=575,016 width=0) (never executed)

  • Index Cond: (car_cd_unidade_negocio = 332)
38. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_pkey on administradora adm_4 (cost=0.28..1.17 rows=1 width=24) (never executed)

  • Index Cond: (adm_cd_administradora = car_4.car_cd_administradora)
39. 0.000 0.000 ↓ 0.0 0

Index Scan using administradora_edi_pkey on administradora_edi ade (cost=0.15..0.17 rows=1 width=4) (never executed)

  • Index Cond: (ade_cd_administradora_edi = adm_4.adm_cd_administradora_edi)
  • Filter: (ade_cd_gestora = 2)
40. 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.57 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_4.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
41. 0.000 0.000 ↓ 0.0 0

Subquery Scan on x_3 (cost=6,046.88..6,082.74 rows=2,869 width=200) (never executed)

42. 0.000 0.000 ↓ 0.0 0

Sort (cost=6,046.88..6,054.05 rows=2,869 width=209) (never executed)

  • 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
43. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=3,483.11..5,882.10 rows=2,869 width=209) (never executed)

  • Hash Cond: (car_5.car_cd_administradora = adm_5.adm_cd_administradora)
44. 0.000 0.000 ↓ 0.0 0

Merge Anti Join (cost=3,132.81..5,481.24 rows=2,869 width=163) (never executed)

  • Merge Cond: (car_5.car_cd_cartao = cartao_edi_5.cae_cd_cartao)
45. 0.000 0.000 ↓ 0.0 0

Sort (cost=3,132.39..3,139.58 rows=2,875 width=163) (never executed)

  • Sort Key: car_5.car_cd_cartao
46. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_idx_autorizacao on cartao car_5 (cost=0.56..2,967.23 rows=2,875 width=163) (never executed)

  • Index Cond: ((car_cd_unidade_negocio = 332) AND ((car_ds_autorizacao)::text = '621942'::text))
  • Filter: (car_cd_cartao <> '-1'::integer)
47. 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..14,834.41 rows=421,780 width=4) (never executed)

  • Filter: (cae_cd_unidade_negocio = 332)
48. 0.000 0.000 ↓ 0.0 0

Hash (cost=254.02..254.02 rows=7,702 width=20) (never executed)

49. 0.000 0.000 ↓ 0.0 0

Seq Scan on administradora adm_5 (cost=0.00..254.02 rows=7,702 width=20) (never executed)

50. 0.000 0.000 ↓ 0.0 0

Subquery Scan on x_4 (cost=7,045.26..7,047.56 rows=184 width=200) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Sort (cost=7,045.26..7,045.72 rows=184 width=204) (never executed)

  • Sort Key: (((car_6.car_ds_autorizacao)::text <-> '621942'::text)), car_6.car_dt_movimento DESC, car_6.car_dt_bom_para
52. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=6,142.07..7,038.34 rows=184 width=204) (never executed)

53. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6,141.64..6,561.33 rows=184 width=175) (never executed)

54. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on cartao car_6 (cost=6,141.36..6,346.63 rows=184 width=159) (never executed)

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

BitmapAnd (cost=6,141.36..6,141.36 rows=184 width=0) (never executed)

56. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cartao_gin_autorizacao (cost=0.00..88.74 rows=9,485 width=0) (never executed)

  • Index Cond: ((car_ds_autorizacao)::text ~~* '%621942%'::text)
57. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cartao_idx (cost=0.00..6,052.28 rows=575,016 width=0) (never executed)

  • Index Cond: (car_cd_unidade_negocio = 332)
58. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (adm_cd_administradora = car_6.car_cd_administradora)
59. 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.57 rows=1 width=4) (never executed)

  • Index Cond: (cae_cd_cartao = car_6.car_cd_cartao)
  • Filter: (cae_cd_unidade_negocio = 332)
60. 0.000 0.000 ↓ 0.0 0

Sort (cost=6,354.38..6,354.39 rows=1 width=200) (never executed)

  • Sort Key: car_7.car_dt_movimento DESC, car_7.car_dt_bom_para
61. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=6,141.97..6,354.37 rows=1 width=200) (never executed)

62. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6,141.55..6,349.50 rows=1 width=175) (never executed)

63. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on cartao car_7 (cost=6,141.27..6,347.00 rows=1 width=159) (never executed)

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

BitmapAnd (cost=6,141.27..6,141.27 rows=184 width=0) (never executed)

65. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cartao_gin_autorizacao (cost=0.00..88.74 rows=9,485 width=0) (never executed)

  • Index Cond: ((car_ds_autorizacao)::text ~~* '%621942%'::text)
66. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cartao_idx (cost=0.00..6,052.28 rows=575,016 width=0) (never executed)

  • Index Cond: (car_cd_unidade_negocio = 332)
67. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (adm_cd_administradora = car_7.car_cd_administradora)
68. 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)
69. 0.000 0.000 ↓ 0.0 0

Sort (cost=10.18..10.19 rows=1 width=200) (never executed)

  • Sort Key: car_8.car_dt_bom_para
70. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=1.27..10.17 rows=1 width=200) (never executed)

71. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..5.30 rows=1 width=175) (never executed)

72. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_idx_filial_adm_dt_valor_aut on cartao car_8 (cost=0.56..2.79 rows=1 width=159) (never executed)

  • 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)
73. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (adm_cd_administradora = 7,870)
74. 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 : 19.304 ms
Execution time : 0.491 ms