explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CBZn

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 3.374 ↑ 1.0 1 1

Limit (cost=10.19..18.82 rows=1 width=200) (actual time=3.374..3.374 rows=1 loops=1)

2. 0.001 3.372 ↑ 3,070.0 1 1

Append (cost=10.19..26,492.74 rows=3,070 width=200) (actual time=3.372..3.372 rows=1 loops=1)

3. 0.001 0.032 ↓ 0.0 0 1

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

4. 0.004 0.031 ↓ 0.0 0 1

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

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

7. 0.026 0.026 ↓ 0.0 0 1

Index Scan using cartao_idx_filial_aut_adm_dt_valor 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_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)))
  • 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 3.280 ↓ 0.0 0 1

Sort (cost=112.91..112.92 rows=1 width=200) (actual time=3.279..3.280 rows=0 loops=1)

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

Nested Loop Anti Join (cost=100.61..112.90 rows=1 width=200) (actual time=3.277..3.277 rows=0 loops=1)

12. 0.000 3.277 ↓ 0.0 0 1

Nested Loop (cost=100.18..108.03 rows=1 width=175) (actual time=3.277..3.277 rows=0 loops=1)

13. 1.133 3.277 ↓ 0.0 0 1

Bitmap Heap Scan on cartao car_1 (cost=99.90..105.52 rows=1 width=159) (actual time=3.277..3.277 rows=0 loops=1)

  • Recheck Cond: ((car_dt_movimento = '2020-06-05'::date) AND (car_cd_administradora = 7,870))
  • Rows Removed by Index Recheck: 3,205
  • Filter: (((car_ds_autorizacao)::text ~~* '%621942%'::text) AND (car_cd_cartao <> '-1'::integer) AND (car_vl_cartao = 227.0) AND (car_cd_unidade_negocio = 332))
  • Rows Removed by Filter: 1
  • Heap Blocks: lossy=59
14. 0.327 2.144 ↓ 0.0 0 1

BitmapAnd (cost=99.90..99.90 rows=5 width=0) (actual time=2.144..2.144 rows=0 loops=1)

15. 1.466 1.466 ↓ 4.1 80,640 1

Bitmap Index Scan on cartao_car_dt_movimento_idx (cost=0.00..15.29 rows=19,595 width=0) (actual time=1.466..1.466 rows=80,640 loops=1)

  • Index Cond: (car_dt_movimento = '2020-06-05'::date)
16. 0.351 0.351 ↑ 3.0 2,624 1

Bitmap Index Scan on cartao_idx_administradora (cost=0.00..84.37 rows=7,947 width=0) (actual time=0.351..0.351 rows=2,624 loops=1)

  • Index Cond: (car_cd_administradora = 7,870)
17. 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)
18. 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)
19. 0.002 0.059 ↑ 1.0 1 1

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

20. 0.007 0.057 ↑ 1.0 1 1

Sort (cost=61.50..61.51 rows=1 width=208) (actual time=0.057..0.057 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
21. 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)

22. 0.005 0.037 ↑ 1.0 1 1

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

23. 0.024 0.024 ↑ 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.023..0.024 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))
24. 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)
25. 0.007 0.007 ↓ 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.007..0.007 rows=0 loops=1)

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

Subquery Scan on x_2 (cost=71.99..72.00 rows=1 width=200) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Sort (cost=71.99..71.99 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
28. 0.000 0.000 ↓ 0.0 0

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

29. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..67.10 rows=1 width=179) (never executed)

30. 0.000 0.000 ↓ 0.0 0

Index Scan using cartao_idx_filial_aut_adm_dt_valor on cartao car_3 (cost=0.56..64.60 rows=1 width=163) (never executed)

  • 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)
31. 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)
32. 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)
33. 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
34. 0.000 0.000 ↓ 0.0 0

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

35. 0.000 0.000 ↓ 0.0 0

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

36. 0.000 0.000 ↓ 0.0 0

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

37. 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)
38. 0.000 0.000 ↓ 0.0 0

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

39. 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)
40. 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)
41. 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)
42. 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)
43. 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)
44. 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)

45. 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
46. 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)
47. 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)
48. 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
49. 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)
50. 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)
51. 0.000 0.000 ↓ 0.0 0

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

52. 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)

53. 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)

54. 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
55. 0.000 0.000 ↓ 0.0 0

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

56. 0.000 0.000 ↓ 0.0 0

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

57. 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)
58. 0.000 0.000 ↓ 0.0 0

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

59. 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)
60. 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)
61. 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)
62. 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)
63. 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
64. 0.000 0.000 ↓ 0.0 0

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

65. 0.000 0.000 ↓ 0.0 0

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

66. 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))
67. 0.000 0.000 ↓ 0.0 0

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

68. 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)
69. 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)
70. 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)
71. 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)
72. 0.000 0.000 ↓ 0.0 0

Sort (cost=112.90..112.91 rows=1 width=200) (never executed)

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

Nested Loop Anti Join (cost=100.61..112.89 rows=1 width=200) (never executed)

74. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=100.18..108.02 rows=1 width=175) (never executed)

75. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on cartao car_8 (cost=99.90..105.51 rows=1 width=159) (never executed)

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

BitmapAnd (cost=99.90..99.90 rows=5 width=0) (never executed)

77. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cartao_car_dt_movimento_idx (cost=0.00..15.29 rows=19,595 width=0) (never executed)

  • Index Cond: (car_dt_movimento = '2020-06-05'::date)
78. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cartao_idx_administradora (cost=0.00..84.37 rows=7,947 width=0) (never executed)

  • Index Cond: (car_cd_administradora = 7,870)
79. 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)
80. 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 : 9.922 ms
Execution time : 3.776 ms