explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hHgFN

Settings
# exclusive inclusive rows x rows loops node
1. 1.637 432.884 ↓ 5.6 96 1

Sort (cost=14,441,876.17..14,441,876.21 rows=17 width=4,861) (actual time=432.866..432.884 rows=96 loops=1)

  • Sort Key: cr.dat_realizacao_checklist DESC, cr.dat_criacao DESC, crs.num_ordem
  • Sort Method: quicksort Memory: 122kB
2. 17.563 431.247 ↓ 5.6 96 1

Nested Loop (cost=3.79..14,441,875.82 rows=17 width=4,861) (actual time=34.479..431.247 rows=96 loops=1)

3. 0.005 0.049 ↑ 1.0 1 1

Limit (cost=0.15..8.17 rows=1 width=48) (actual time=0.046..0.049 rows=1 loops=1)

4. 0.044 0.044 ↑ 1.0 1 1

Index Scan using plano_qualidade_empresa_id_empresa_idx on plano_qualidade_empresa plano (cost=0.15..8.17 rows=1 width=48) (actual time=0.043..0.044 rows=1 loops=1)

  • Index Cond: ((id_empresa)::text = 'RKKIHSQDCNHI'::text)
5. 0.494 3.715 ↓ 5.6 96 1

Nested Loop Left Join (cost=3.64..194.15 rows=17 width=968) (actual time=0.747..3.715 rows=96 loops=1)

6. 0.365 3.029 ↓ 5.6 96 1

Nested Loop (cost=3.37..189.22 rows=17 width=964) (actual time=0.710..3.029 rows=96 loops=1)

7. 0.035 2.180 ↓ 1.3 4 1

Nested Loop (cost=2.81..180.68 rows=3 width=679) (actual time=0.646..2.180 rows=4 loops=1)

8. 0.041 1.945 ↓ 4.0 4 1

Nested Loop Left Join (cost=2.25..147.93 rows=1 width=595) (actual time=0.576..1.945 rows=4 loops=1)

9. 0.035 1.620 ↓ 4.0 4 1

Nested Loop Left Join (cost=1.83..139.50 rows=1 width=587) (actual time=0.502..1.620 rows=4 loops=1)

10. 0.033 1.349 ↓ 4.0 4 1

Nested Loop (cost=1.54..131.19 rows=1 width=520) (actual time=0.434..1.349 rows=4 loops=1)

11. 0.039 1.068 ↑ 1.0 4 1

Nested Loop (cost=1.26..97.90 rows=4 width=520) (actual time=0.373..1.068 rows=4 loops=1)

12. 0.043 0.841 ↑ 1.0 4 1

Nested Loop Left Join (cost=0.99..68.72 rows=4 width=468) (actual time=0.310..0.841 rows=4 loops=1)

13. 0.054 0.594 ↑ 1.0 4 1

Nested Loop Left Join (cost=0.71..66.96 rows=4 width=431) (actual time=0.241..0.594 rows=4 loops=1)

14. 0.324 0.324 ↑ 1.0 4 1

Index Scan using checklist_realizado_pk on checklist_realizado cr (cost=0.42..33.77 rows=4 width=401) (actual time=0.158..0.324 rows=4 loops=1)

  • Index Cond: ((id)::text = ANY ('{07167483-f06c-439e-a135-9353599ed717,22bd7040-02b7-400b-8704-d00947df4814,08891011-124d-4b7b-a44e-37b03298c6cf,76432911-7c36-4903-a276-c327ba4592be}'::text[]))
  • Filter: (dat_inativacao IS NULL)
15. 0.216 0.216 ↑ 1.0 1 4

Index Scan using plano_qualidade_pk on plano_qualidade pq (cost=0.28..8.30 rows=1 width=44) (actual time=0.054..0.054 rows=1 loops=4)

  • Index Cond: ((cr.id_plano_qualidade)::text = (id)::text)
16. 0.204 0.204 ↑ 1.0 1 4

Index Scan using obra_pk on obra o (cost=0.28..0.44 rows=1 width=65) (actual time=0.051..0.051 rows=1 loops=4)

  • Index Cond: ((pq.id_obra)::text = (id)::text)
17. 0.188 0.188 ↑ 1.0 1 4

Index Scan using tipo_checklist_pk on tipo_checklist tc (cost=0.28..7.29 rows=1 width=80) (actual time=0.047..0.047 rows=1 loops=4)

  • Index Cond: ((id)::text = (cr.id_tipo_checklist)::text)
18. 0.248 0.248 ↑ 1.0 1 4

Index Scan using checklist_pk on checklist c (cost=0.28..8.30 rows=1 width=14) (actual time=0.062..0.062 rows=1 loops=4)

  • Index Cond: ((id)::text = (cr.id_checklist)::text)
  • Filter: ((id_empresa)::text = 'RKKIHSQDCNHI'::text)
19. 0.236 0.236 ↑ 1.0 1 4

Index Scan using empreiteira_pk on empreiteira emp (cost=0.29..8.31 rows=1 width=97) (actual time=0.059..0.059 rows=1 loops=4)

  • Index Cond: ((cr.id_empreiteira)::text = (id)::text)
20. 0.284 0.284 ↑ 1.0 1 4

Index Scan using colaborador_pk on colaborador colab_resp (cost=0.42..8.44 rows=1 width=43) (actual time=0.071..0.071 rows=1 loops=4)

  • Index Cond: ((cr.id_colaborador)::text = (id)::text)
21. 0.200 0.200 ↑ 7.0 1 4

Index Scan using checklist_realizado_secao_checklist_idx on checklist_realizado_secao crs (cost=0.56..32.68 rows=7 width=120) (actual time=0.048..0.050 rows=1 loops=4)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
22. 0.484 0.484 ↑ 1.7 24 4

Index Scan using checklist_realizado_item_secao_idx on checklist_realizado_item cri (cost=0.56..2.45 rows=40 width=321) (actual time=0.051..0.121 rows=24 loops=4)

  • Index Cond: ((id_checklist_realizado_secao)::text = (crs.id)::text)
23. 0.192 0.192 ↓ 0.0 0 96

Index Scan using tipo_item_checklist_pk on tipo_item_checklist tic (cost=0.27..0.29 rows=1 width=34) (actual time=0.002..0.002 rows=0 loops=96)

  • Index Cond: ((id)::text = (cri.id_tipo_item_checklist)::text)
  • Filter: (dat_inativacao IS NULL)
24.          

SubPlan (forNested Loop)

25. 0.768 7.104 ↑ 1.0 1 96

Nested Loop (cost=0.55..16.60 rows=1 width=41) (actual time=0.072..0.074 rows=1 loops=96)

26. 2.880 2.880 ↑ 1.0 1 96

Index Scan using dominio_valor_pk on dominio_valor dvtipoemp (cost=0.27..8.29 rows=1 width=8) (actual time=0.029..0.030 rows=1 loops=96)

  • Index Cond: ((id)::text = (emp.id_dominio_valor_tipo_empreiteira)::text)
27. 3.456 3.456 ↑ 1.0 1 96

Index Scan using traducao_texto_i18n_lingua_uk on traducao_texto_i18n tradtipoemp (cost=0.28..8.30 rows=1 width=52) (actual time=0.035..0.036 rows=1 loops=96)

  • Index Cond: (((id_lingua_i18n)::text = 'pt_BR'::text) AND ((id_texto_i18n)::text = (dvtipoemp.id_texto_i18n)::text))
28. 0.864 7.104 ↑ 1.0 1 96

Nested Loop (cost=0.55..16.60 rows=1 width=41) (actual time=0.072..0.074 rows=1 loops=96)

29. 2.592 2.592 ↑ 1.0 1 96

Index Scan using dominio_valor_pk on dominio_valor dvabordagem (cost=0.27..8.29 rows=1 width=8) (actual time=0.026..0.027 rows=1 loops=96)

  • Index Cond: ((id)::text = (cr.id_dominio_valor_abordagem_calculo)::text)
30. 3.648 3.648 ↑ 1.0 1 96

Index Scan using traducao_texto_i18n_lingua_uk on traducao_texto_i18n tradabordagem (cost=0.28..8.30 rows=1 width=52) (actual time=0.037..0.038 rows=1 loops=96)

  • Index Cond: (((id_lingua_i18n)::text = 'pt_BR'::text) AND ((id_texto_i18n)::text = (dvabordagem.id_texto_i18n)::text))
31. 0.528 3.552 ↓ 0.0 0 96

Nested Loop (cost=0.55..16.60 rows=1 width=41) (actual time=0.036..0.037 rows=0 loops=96)

32. 1.344 1.344 ↓ 0.0 0 96

Index Scan using dominio_valor_pk on dominio_valor dvtipoatend (cost=0.27..8.29 rows=1 width=8) (actual time=0.014..0.014 rows=0 loops=96)

  • Index Cond: ((id)::text = (cr.id_dominio_valor_tipo_atendimento_avaliado)::text)
33. 1.680 1.680 ↑ 1.0 1 48

Index Scan using traducao_texto_i18n_lingua_uk on traducao_texto_i18n tradtipoatend (cost=0.28..8.30 rows=1 width=52) (actual time=0.034..0.035 rows=1 loops=48)

  • Index Cond: (((id_lingua_i18n)::text = 'pt_BR'::text) AND ((id_texto_i18n)::text = (dvtipoatend.id_texto_i18n)::text))
34. 0.576 5.760 ↑ 1.0 1 96

Nested Loop (cost=0.55..16.60 rows=1 width=41) (actual time=0.058..0.060 rows=1 loops=96)

35. 2.112 2.112 ↑ 1.0 1 96

Index Scan using dominio_valor_pk on dominio_valor dvcateg (cost=0.27..8.29 rows=1 width=8) (actual time=0.022..0.022 rows=1 loops=96)

  • Index Cond: ((id)::text = (tc.id_dominio_valor_categoria_checklist)::text)
36. 3.072 3.072 ↑ 1.0 1 96

Index Scan using traducao_texto_i18n_lingua_uk on traducao_texto_i18n tradcat (cost=0.28..8.30 rows=1 width=52) (actual time=0.031..0.032 rows=1 loops=96)

  • Index Cond: (((id_lingua_i18n)::text = 'pt_BR'::text) AND ((id_texto_i18n)::text = (dvcateg.id_texto_i18n)::text))
37. 0.192 3.648 ↓ 0.0 0 96

GroupAggregate (cost=1.13..30.01 rows=2 width=68) (actual time=0.038..0.038 rows=0 loops=96)

  • Group Key: crc.id_checklist_realizado
38. 0.096 3.456 ↓ 0.0 0 96

Nested Loop (cost=1.13..29.96 rows=2 width=60) (actual time=0.036..0.036 rows=0 loops=96)

39. 0.192 3.360 ↓ 0.0 0 96

Nested Loop (cost=0.84..29.33 rows=2 width=75) (actual time=0.035..0.035 rows=0 loops=96)

40. 3.168 3.168 ↓ 0.0 0 96

Index Scan using checklist_realizado_colaborador_checklist_idx on checklist_realizado_colaborador crc (cost=0.42..12.46 rows=2 width=53) (actual time=0.033..0.033 rows=0 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
  • Filter: (dat_inativacao IS NULL)
41. 0.000 0.000 ↓ 0.0 0

Index Scan using colaborador_pk on colaborador c_1 (cost=0.42..8.44 rows=1 width=58) (never executed)

  • Index Cond: ((id)::text = (crc.id_colaborador)::text)
42. 0.000 0.000 ↓ 0.0 0

Index Only Scan using empreiteira_pk on empreiteira e (cost=0.29..0.32 rows=1 width=15) (never executed)

  • Index Cond: (id = (c_1.id_empreiteira)::text)
  • Heap Fetches: 0
43. 0.384 5.184 ↓ 0.0 0 96

GroupAggregate (cost=41.90..41.96 rows=1 width=68) (actual time=0.054..0.054 rows=0 loops=96)

  • Group Key: locais.id_checklist_realizado
44. 0.864 4.800 ↓ 0.0 0 96

Sort (cost=41.90..41.90 rows=3 width=60) (actual time=0.050..0.050 rows=0 loops=96)

  • Sort Key: locais.id_checklist_realizado
  • Sort Method: quicksort Memory: 25kB
45. 0.192 3.936 ↓ 0.0 0 96

Subquery Scan on locais (cost=41.84..41.87 rows=3 width=60) (actual time=0.041..0.041 rows=0 loops=96)

46. 0.384 3.744 ↓ 0.0 0 96

Sort (cost=41.84..41.84 rows=3 width=60) (actual time=0.039..0.039 rows=0 loops=96)

  • Sort Key: l.cod_local
  • Sort Method: quicksort Memory: 25kB
47. 0.192 3.360 ↓ 0.0 0 96

Nested Loop (cost=0.85..41.81 rows=3 width=60) (actual time=0.035..0.035 rows=0 loops=96)

48. 3.168 3.168 ↓ 0.0 0 96

Index Scan using checklist_realizado_local_checklist_idx on checklist_realizado_local crl (cost=0.42..16.48 rows=3 width=52) (actual time=0.033..0.033 rows=0 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
  • Filter: (dat_inativacao IS NULL)
49. 0.000 0.000 ↓ 0.0 0

Index Scan using local_pk on local l (cost=0.43..8.45 rows=1 width=41) (never executed)

  • Index Cond: ((id)::text = (crl.id_local)::text)
50. 0.192 3.360 ↓ 0.0 0 96

GroupAggregate (cost=0.85..16.91 rows=1 width=68) (actual time=0.035..0.035 rows=0 loops=96)

  • Group Key: crs_1.id_checklist_realizado
51. 0.288 3.168 ↓ 0.0 0 96

Nested Loop (cost=0.85..16.88 rows=1 width=86) (actual time=0.033..0.033 rows=0 loops=96)

52. 2.880 2.880 ↓ 0.0 0 96

Index Scan using checklist_realizado_servico_checklist_idx on checklist_realizado_servico crs_1 (cost=0.42..8.44 rows=1 width=52) (actual time=0.030..0.030 rows=0 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
  • Filter: (dat_inativacao IS NULL)
53. 0.000 0.000 ↓ 0.0 0

Index Scan using servico_pk on servico s (cost=0.42..8.44 rows=1 width=66) (never executed)

  • Index Cond: ((id)::text = (crs_1.id_servico)::text)
54. 1.824 9.888 ↑ 1.0 1 96

GroupAggregate (cost=0.70..16.76 rows=1 width=68) (actual time=0.103..0.103 rows=1 loops=96)

  • Group Key: cre.id_checklist_realizado
55. 0.864 8.064 ↑ 1.0 1 96

Nested Loop (cost=0.70..16.73 rows=1 width=65) (actual time=0.081..0.084 rows=1 loops=96)

56. 3.072 3.072 ↑ 1.0 1 96

Index Scan using checklist_realizado_equipamento_checklist_idx on checklist_realizado_equipamento cre (cost=0.41..8.43 rows=1 width=51) (actual time=0.030..0.032 rows=1 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
  • Filter: (dat_inativacao IS NULL)
57. 4.128 4.128 ↑ 1.0 1 96

Index Scan using equipamento_pk on equipamento e_1 (cost=0.28..8.30 rows=1 width=49) (actual time=0.043..0.043 rows=1 loops=96)

  • Index Cond: ((id)::text = (cre.id_equipamento)::text)
58. 0.096 3.936 ↓ 0.0 0 96

GroupAggregate (cost=4.59..28.45 rows=2 width=68) (actual time=0.041..0.041 rows=0 loops=96)

  • Group Key: cri_1.id_checklist_realizado
59. 0.960 3.840 ↓ 0.0 0 96

Nested Loop (cost=4.59..28.39 rows=2 width=86) (actual time=0.040..0.040 rows=0 loops=96)

60. 0.384 2.880 ↓ 0.0 0 96

Bitmap Heap Scan on insumo_checklist_realizado cri_1 (cost=4.30..11.77 rows=2 width=52) (actual time=0.030..0.030 rows=0 loops=96)

  • Recheck Cond: ((id_checklist_realizado)::text = (cr.id)::text)
  • Filter: (dat_inativacao IS NULL)
61. 2.496 2.496 ↓ 0.0 0 96

Bitmap Index Scan on insumo_checklist_realizado_checklist_idx (cost=0.00..4.30 rows=2 width=0) (actual time=0.026..0.026 rows=0 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
62. 0.000 0.000 ↓ 0.0 0

Index Scan using insumo_pk on insumo i (cost=0.29..8.31 rows=1 width=65) (never executed)

  • Index Cond: ((id)::text = (cri_1.id_insumo)::text)
63. 0.864 6.336 ↑ 1.0 1 96

Nested Loop (cost=0.55..16.60 rows=1 width=41) (actual time=0.063..0.066 rows=1 loops=96)

64. 2.496 2.496 ↑ 1.0 1 96

Index Scan using dominio_valor_pk on dominio_valor dvstatus (cost=0.27..8.29 rows=1 width=8) (actual time=0.025..0.026 rows=1 loops=96)

  • Index Cond: ((id)::text = (cr.id_dominio_valor_status)::text)
65. 2.976 2.976 ↑ 1.0 1 96

Index Scan using traducao_texto_i18n_lingua_uk on traducao_texto_i18n tradstatus (cost=0.28..8.30 rows=1 width=52) (actual time=0.030..0.031 rows=1 loops=96)

  • Index Cond: (((id_lingua_i18n)::text = 'pt_BR'::text) AND ((id_texto_i18n)::text = (dvstatus.id_texto_i18n)::text))
66. 0.672 5.856 ↑ 1.0 1 96

Nested Loop (cost=0.55..16.60 rows=1 width=41) (actual time=0.059..0.061 rows=1 loops=96)

67. 2.304 2.304 ↑ 1.0 1 96

Index Scan using dominio_valor_pk on dominio_valor dvresposta (cost=0.27..8.29 rows=1 width=8) (actual time=0.023..0.024 rows=1 loops=96)

  • Index Cond: ((id)::text = (cri.id_dominio_valor_tipo_resposta)::text)
68. 2.880 2.880 ↑ 1.0 1 96

Index Scan using traducao_texto_i18n_lingua_uk on traducao_texto_i18n tradtiporesposta (cost=0.28..8.30 rows=1 width=52) (actual time=0.029..0.030 rows=1 loops=96)

  • Index Cond: (((id_lingua_i18n)::text = 'pt_BR'::text) AND ((id_texto_i18n)::text = (dvresposta.id_texto_i18n)::text))
69. 0.672 4.800 ↑ 1.0 1 96

Nested Loop (cost=0.55..16.60 rows=1 width=41) (actual time=0.048..0.050 rows=1 loops=96)

70. 1.632 1.632 ↑ 1.0 1 96

Index Scan using dominio_valor_pk on dominio_valor dvconf (cost=0.27..8.29 rows=1 width=8) (actual time=0.017..0.017 rows=1 loops=96)

  • Index Cond: ((id)::text = (cri.id_dominio_valor_status_conformidade)::text)
71. 2.496 2.496 ↑ 1.0 1 96

Index Scan using traducao_texto_i18n_lingua_uk on traducao_texto_i18n tradsitconformidade (cost=0.28..8.30 rows=1 width=52) (actual time=0.025..0.026 rows=1 loops=96)

  • Index Cond: (((id_lingua_i18n)::text = 'pt_BR'::text) AND ((id_texto_i18n)::text = (dvconf.id_texto_i18n)::text))
72. 2.976 14.592 ↑ 1.0 1 96

GroupAggregate (cost=1.12..121.97 rows=1 width=68) (actual time=0.151..0.152 rows=1 loops=96)

  • Group Key: crle.id
73. 0.960 11.616 ↓ 2.0 2 96

Nested Loop Left Join (cost=1.12..121.95 rows=1 width=52) (actual time=0.114..0.121 rows=2 loops=96)

  • Join Filter: ((cre_1.id_checklist_realizado_lista_escolha)::text = (crle.id)::text)
74. 5.376 5.376 ↑ 1.0 1 96

Index Only Scan using checklist_realizado_lista_escolha_pk on checklist_realizado_lista_escolha crle (cost=0.56..8.58 rows=1 width=36) (actual time=0.055..0.056 rows=1 loops=96)

  • Index Cond: (id = (cri.id_checklist_realizado_lista_escolha)::text)
  • Heap Fetches: 96
75. 5.280 5.280 ↑ 13.5 2 96

Index Scan using checklist_realizado_escolha_lista_idx on checklist_realizado_escolha cre_1 (cost=0.56..113.03 rows=27 width=52) (actual time=0.051..0.055 rows=2 loops=96)

  • Index Cond: ((id_checklist_realizado_lista_escolha)::text = (cri.id_checklist_realizado_lista_escolha)::text)
76. 1.152 10.656 ↑ 1.0 1 96

GroupAggregate (cost=1.12..121.73 rows=1 width=68) (actual time=0.111..0.111 rows=1 loops=96)

  • Group Key: crle_1.id
77. 0.768 9.504 ↑ 1.0 1 96

Nested Loop Left Join (cost=1.12..121.71 rows=1 width=52) (actual time=0.093..0.099 rows=1 loops=96)

  • Join Filter: ((cre_2.id_checklist_realizado_lista_escolha)::text = (crle_1.id)::text)
78. 4.320 4.320 ↑ 1.0 1 96

Index Only Scan using checklist_realizado_lista_escolha_pk on checklist_realizado_lista_escolha crle_1 (cost=0.56..8.58 rows=1 width=36) (actual time=0.044..0.045 rows=1 loops=96)

  • Index Cond: (id = (cri.id_checklist_realizado_lista_escolha)::text)
  • Heap Fetches: 96
79. 4.416 4.416 ↑ 8.0 1 96

Index Scan using checklist_realizado_escolha_lista_idx on checklist_realizado_escolha cre_2 (cost=0.56..113.03 rows=8 width=52) (actual time=0.043..0.046 rows=1 loops=96)

  • Index Cond: ((id_checklist_realizado_lista_escolha)::text = (cri.id_checklist_realizado_lista_escolha)::text)
  • Filter: flg_selecionado
  • Rows Removed by Filter: 1
80. 0.288 3.648 ↓ 0.0 0 96

GroupAggregate (cost=0.42..8.45 rows=1 width=44) (actual time=0.038..0.038 rows=0 loops=96)

  • Group Key: q.id_checklist_realizado_item
81. 3.360 3.360 ↓ 0.0 0 96

Index Scan using questao_id_checklist_realizado_item_idx on questao q (cost=0.42..8.44 rows=1 width=36) (actual time=0.035..0.035 rows=0 loops=96)

  • Index Cond: ((id_checklist_realizado_item)::text = (cri.id)::text)
  • Filter: (dat_inativacao IS NULL)
  • Rows Removed by Filter: 0
82. 0.192 2.592 ↓ 0.0 0 96

GroupAggregate (cost=0.42..8.46 rows=1 width=68) (actual time=0.027..0.027 rows=0 loops=96)

  • Group Key: q_1.id_checklist_realizado_item
83. 2.400 2.400 ↓ 0.0 0 96

Index Scan using questao_id_checklist_realizado_item_idx on questao q_1 (cost=0.42..8.44 rows=1 width=44) (actual time=0.025..0.025 rows=0 loops=96)

  • Index Cond: ((id_checklist_realizado_item)::text = (cri.id)::text)
  • Filter: (dat_inativacao IS NULL)
  • Rows Removed by Filter: 0
84. 3.264 55.488 ↑ 7.0 1 96

GroupAggregate (cost=1.39..1,204.25 rows=7 width=44) (actual time=0.578..0.578 rows=1 loops=96)

  • Group Key: crs1.id_checklist_realizado
85. 8.160 52.224 ↑ 1.7 24 96

Nested Loop (cost=1.39..1,203.88 rows=40 width=38) (actual time=0.113..0.544 rows=24 loops=96)

86. 3.360 14.112 ↑ 1.7 24 96

Nested Loop (cost=1.12..1,192.28 rows=40 width=43) (actual time=0.090..0.147 rows=24 loops=96)

87. 4.032 4.032 ↑ 7.0 1 96

Index Scan using checklist_realizado_secao_checklist_idx on checklist_realizado_secao crs1 (cost=0.56..32.68 rows=7 width=72) (actual time=0.041..0.042 rows=1 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
88. 6.720 6.720 ↑ 1.7 24 96

Index Scan using checklist_realizado_item_secao_idx on checklist_realizado_item cri1 (cost=0.56..165.26 rows=40 width=43) (actual time=0.040..0.070 rows=24 loops=96)

  • Index Cond: ((id_checklist_realizado_secao)::text = (crs1.id)::text)
89. 29.952 29.952 ↑ 1.0 1 2,304

Index Scan using dominio_valor_pk on dominio_valor dominio (cost=0.27..0.29 rows=1 width=10) (actual time=0.013..0.013 rows=1 loops=2,304)

  • Index Cond: ((id)::text = (cri1.id_dominio_valor_status_conformidade)::text)
90. 3.360 54.816 ↑ 7.0 1 96

GroupAggregate (cost=1.39..1,204.25 rows=7 width=44) (actual time=0.570..0.571 rows=1 loops=96)

  • Group Key: crs1_1.id_checklist_realizado
91. 7.488 51.456 ↑ 1.7 24 96

Nested Loop (cost=1.39..1,203.88 rows=40 width=38) (actual time=0.112..0.536 rows=24 loops=96)

92. 3.360 14.016 ↑ 1.7 24 96

Nested Loop (cost=1.12..1,192.28 rows=40 width=43) (actual time=0.090..0.146 rows=24 loops=96)

93. 3.840 3.840 ↑ 7.0 1 96

Index Scan using checklist_realizado_secao_checklist_idx on checklist_realizado_secao crs1_1 (cost=0.56..32.68 rows=7 width=72) (actual time=0.039..0.040 rows=1 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
94. 6.816 6.816 ↑ 1.7 24 96

Index Scan using checklist_realizado_item_secao_idx on checklist_realizado_item cri1_1 (cost=0.56..165.26 rows=40 width=43) (actual time=0.042..0.071 rows=24 loops=96)

  • Index Cond: ((id_checklist_realizado_secao)::text = (crs1_1.id)::text)
95. 29.952 29.952 ↑ 1.0 1 2,304

Index Scan using dominio_valor_pk on dominio_valor dominio_1 (cost=0.27..0.29 rows=1 width=10) (actual time=0.013..0.013 rows=1 loops=2,304)

  • Index Cond: ((id)::text = (cri1_1.id_dominio_valor_status_conformidade)::text)
96. 4.224 54.624 ↑ 2.0 1 96

GroupAggregate (cost=1.39..1,205.11 rows=2 width=44) (actual time=0.569..0.569 rows=1 loops=96)

  • Group Key: crs1_2.id_checklist_realizado
  • Filter: ((sum(CASE WHEN ((dominio_2.val_dominio_valor)::text = '1'::text) THEN 1 ELSE 0 END) + sum(CASE WHEN ((dominio_2.val_dominio_valor)::text = '2'::text) THEN 1 ELSE 0 END)) > 0)
97. 6.720 50.400 ↑ 1.7 24 96

Nested Loop (cost=1.39..1,203.88 rows=40 width=38) (actual time=0.108..0.525 rows=24 loops=96)

98. 3.168 13.728 ↑ 1.7 24 96

Nested Loop (cost=1.12..1,192.28 rows=40 width=43) (actual time=0.086..0.143 rows=24 loops=96)

99. 3.840 3.840 ↑ 7.0 1 96

Index Scan using checklist_realizado_secao_checklist_idx on checklist_realizado_secao crs1_2 (cost=0.56..32.68 rows=7 width=72) (actual time=0.039..0.040 rows=1 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
100. 6.720 6.720 ↑ 1.7 24 96

Index Scan using checklist_realizado_item_secao_idx on checklist_realizado_item cri1_2 (cost=0.56..165.26 rows=40 width=43) (actual time=0.040..0.070 rows=24 loops=96)

  • Index Cond: ((id_checklist_realizado_secao)::text = (crs1_2.id)::text)
101. 29.952 29.952 ↑ 1.0 1 2,304

Index Scan using dominio_valor_pk on dominio_valor dominio_2 (cost=0.27..0.29 rows=1 width=10) (actual time=0.013..0.013 rows=1 loops=2,304)

  • Index Cond: ((id)::text = (cri1_2.id_dominio_valor_status_conformidade)::text)
102. 0.192 3.456 ↓ 0.0 0 96

GroupAggregate (cost=0.85..299.13 rows=1 width=68) (actual time=0.036..0.036 rows=0 loops=96)

  • Group Key: crs_2.id_checklist_realizado
103. 0.288 3.264 ↓ 0.0 0 96

Nested Loop (cost=0.85..299.08 rows=7 width=44) (actual time=0.034..0.034 rows=0 loops=96)

104. 2.976 2.976 ↓ 0.0 0 96

Index Scan using checklist_realizado_servico_checklist_idx on checklist_realizado_servico crs_2 (cost=0.42..8.44 rows=1 width=52) (actual time=0.031..0.031 rows=0 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
105. 0.000 0.000 ↓ 0.0 0

Index Scan using apontamento_detalhe_id_servico_idx on apontamento_detalhe ad (cost=0.43..290.55 rows=9 width=24) (never executed)

  • Index Cond: ((id_servico)::text = (crs_2.id_servico)::text)
  • Filter: (flg_retrabalho AND (dat_inativacao IS NULL))
106. 0.192 3.456 ↓ 0.0 0 96

GroupAggregate (cost=1.13..30.14 rows=2 width=68) (actual time=0.036..0.036 rows=0 loops=96)

  • Group Key: crc_1.id_checklist_realizado
107. 0.096 3.264 ↓ 0.0 0 96

Nested Loop (cost=1.13..30.09 rows=2 width=67) (actual time=0.034..0.034 rows=0 loops=96)

108. 0.288 3.168 ↓ 0.0 0 96

Nested Loop (cost=0.84..29.33 rows=2 width=51) (actual time=0.033..0.033 rows=0 loops=96)

109. 2.880 2.880 ↓ 0.0 0 96

Index Scan using checklist_realizado_colaborador_checklist_idx on checklist_realizado_colaborador crc_1 (cost=0.42..12.46 rows=2 width=53) (actual time=0.030..0.030 rows=0 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
  • Filter: (dat_inativacao IS NULL)
110. 0.000 0.000 ↓ 0.0 0

Index Scan using colaborador_pk on colaborador c_2 (cost=0.42..8.44 rows=1 width=34) (never executed)

  • Index Cond: ((id)::text = (crc_1.id_colaborador)::text)
111. 0.000 0.000 ↓ 0.0 0

Index Scan using empreiteira_pk on empreiteira e_2 (cost=0.29..0.38 rows=1 width=46) (never executed)

  • Index Cond: ((id)::text = (c_2.id_empreiteira)::text)
112. 0.384 35.616 ↓ 0.0 0 96

GroupAggregate (cost=843,259.33..843,259.61 rows=6 width=68) (actual time=0.371..0.371 rows=0 loops=96)

  • Group Key: hierarquia_local.id_checklist_realizado
113.          

CTE hierarquia

114. 0.000 28.866 ↑ 356,028.0 1 1

Recursive Union (cost=1,066.97..833,895.85 rows=356,028 width=59) (actual time=28.865..28.866 rows=1 loops=1)

115. 0.000 129.671 ↑ 218.0 1 1

Gather (cost=1,066.97..35,463.89 rows=218 width=59) (actual time=28.861..129.671 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
116. 99.174 339.329 ↑ 2.6 35 3

Nested Loop (cost=66.97..34,442.09 rows=91 width=59) (actual time=65.083..339.329 rows=35 loops=3)

117. 106.807 240.103 ↑ 1.8 1,827 3

Hash Join (cost=66.54..32,506.10 rows=3,336 width=17) (actual time=11.416..240.103 rows=1,827 loops=3)

  • Hash Cond: ((oblc.id_obra)::text = (obr.id)::text)
118. 132.963 132.963 ↑ 2.2 201,650 3

Parallel Seq Scan on obra_local oblc (cost=0.00..31,286.64 rows=438,664 width=31) (actual time=0.022..132.963 rows=201,650 loops=3)

119. 0.023 0.333 ↑ 1.0 26 3

Hash (cost=66.22..66.22 rows=26 width=14) (actual time=0.332..0.333 rows=26 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
120. 0.200 0.310 ↑ 1.0 26 3

Bitmap Heap Scan on obra obr (cost=4.48..66.22 rows=26 width=14) (actual time=0.139..0.310 rows=26 loops=3)

  • Recheck Cond: ((id_empresa)::text = 'RKKIHSQDCNHI'::text)
  • Heap Blocks: exact=17
121. 0.110 0.110 ↑ 1.0 26 3

Bitmap Index Scan on obra_id_empresa_idx (cost=0.00..4.48 rows=26 width=0) (actual time=0.110..0.110 rows=26 loops=3)

  • Index Cond: ((id_empresa)::text = 'RKKIHSQDCNHI'::text)
122. 0.052 0.052 ↓ 0.0 0 5,482

Index Scan using local_pk on local loc (cost=0.43..0.58 rows=1 width=41) (actual time=0.052..0.052 rows=0 loops=5,482)

  • Index Cond: ((id)::text = (oblc.id_local)::text)
  • Filter: (id_local_grupo IS NULL)
  • Rows Removed by Filter: 1
123. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=65,521.60..79,131.14 rows=35,581 width=59) (never executed)

  • Hash Cond: ((hierq.id)::text = (loc_1.id_local_grupo)::text)
124. 0.000 0.000 ↓ 0.0 0

WorkTable Scan on hierarquia hierq (cost=0.00..43.60 rows=2,180 width=178) (never executed)

125. 0.000 0.000 ↓ 0.0 0

Hash (cost=40,992.60..40,992.60 rows=1,055,360 width=58) (never executed)

126. 0.000 0.000 ↓ 0.0 0

Seq Scan on local loc_1 (cost=0.00..40,992.60 rows=1,055,360 width=58) (never executed)

127. 0.864 35.232 ↓ 0.0 0 96

Sort (cost=9,363.48..9,363.53 rows=19 width=68) (actual time=0.367..0.367 rows=0 loops=96)

  • Sort Key: hierarquia_local.id_checklist_realizado
  • Sort Method: quicksort Memory: 25kB
128. 0.192 34.368 ↓ 0.0 0 96

Subquery Scan on hierarquia_local (cost=9,362.84..9,363.08 rows=19 width=68) (actual time=0.358..0.358 rows=0 loops=96)

129. 0.672 34.176 ↓ 0.0 0 96

Sort (cost=9,362.84..9,362.89 rows=19 width=342) (actual time=0.356..0.356 rows=0 loops=96)

  • Sort Key: hierqloc.cod_local
  • Sort Method: quicksort Memory: 25kB
130. 0.986 33.504 ↓ 0.0 0 96

Hash Join (cost=16.51..9,362.44 rows=19 width=342) (actual time=0.349..0.349 rows=0 loops=96)

  • Hash Cond: ((hierqloc.id)::text = (crl_1.id_local)::text)
131. 28.870 28.870 ↑ 356,028.0 1 1

CTE Scan on hierarquia hierqloc (cost=0.00..7,120.56 rows=356,028 width=452) (actual time=28.870..28.870 rows=1 loops=1)

132. 0.288 3.648 ↓ 0.0 0 96

Hash (cost=16.48..16.48 rows=3 width=52) (actual time=0.038..0.038 rows=0 loops=96)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
133. 3.360 3.360 ↓ 0.0 0 96

Index Scan using checklist_realizado_local_checklist_idx on checklist_realizado_local crl_1 (cost=0.42..16.48 rows=3 width=52) (actual time=0.035..0.035 rows=0 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
  • Filter: (dat_inativacao IS NULL)
134. 3.264 9.408 ↑ 1.0 1 96

Aggregate (cost=165.36..165.39 rows=1 width=8) (actual time=0.097..0.098 rows=1 loops=96)

135. 6.144 6.144 ↑ 1.7 24 96

Index Scan using checklist_realizado_item_secao_idx on checklist_realizado_item cri1_3 (cost=0.56..165.26 rows=40 width=8) (actual time=0.043..0.064 rows=24 loops=96)

  • Index Cond: ((id_checklist_realizado_secao)::text = (crs.id)::text)
136. 0.384 16.608 ↑ 1.0 1 96

Aggregate (cost=142.54..142.56 rows=1 width=8) (actual time=0.173..0.173 rows=1 loops=96)

137. 1.632 16.224 ↓ 0.0 0 96

Nested Loop (cost=12.22..142.53 rows=1 width=8) (actual time=0.169..0.169 rows=0 loops=96)

138. 3.936 3.936 ↑ 7.0 1 96

Index Scan using checklist_realizado_secao_checklist_idx on checklist_realizado_secao crs1_3 (cost=0.56..32.68 rows=7 width=36) (actual time=0.040..0.041 rows=1 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
139. 0.672 10.656 ↓ 0.0 0 96

Bitmap Heap Scan on checklist_realizado_item cri1_4 (cost=11.67..15.68 rows=1 width=44) (actual time=0.111..0.111 rows=0 loops=96)

  • Recheck Cond: (((id_checklist_realizado_secao)::text = (crs1_3.id)::text) AND (val_perc_resposta_bp_nota > '0'::double precision))
140. 0.576 9.984 ↓ 0.0 0 96

BitmapAnd (cost=11.67..11.67 rows=1 width=0) (actual time=0.104..0.104 rows=0 loops=96)

141. 4.704 4.704 ↑ 1.7 24 96

Bitmap Index Scan on checklist_realizado_item_secao_idx (cost=0.00..4.86 rows=40 width=0) (actual time=0.049..0.049 rows=24 loops=96)

  • Index Cond: ((id_checklist_realizado_secao)::text = (crs1_3.id)::text)
142. 4.704 4.704 ↑ 1.5 188 96

Bitmap Index Scan on check_real_item_perc_bp_nota_idx (cost=0.00..6.49 rows=274 width=0) (actual time=0.049..0.049 rows=188 loops=96)

  • Index Cond: (val_perc_resposta_bp_nota > '0'::double precision)
143. 0.576 50.400 ↑ 1.0 1 96

Aggregate (cost=271.73..271.75 rows=1 width=8) (actual time=0.524..0.525 rows=1 loops=96)

144. 1.344 49.824 ↓ 0.0 0 96

Nested Loop (cost=30.68..271.72 rows=1 width=8) (actual time=0.519..0.519 rows=0 loops=96)

145. 4.032 4.032 ↑ 7.0 1 96

Index Scan using checklist_realizado_secao_checklist_idx on checklist_realizado_secao crs1_4 (cost=0.56..32.68 rows=7 width=36) (actual time=0.040..0.042 rows=1 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
146. 0.480 44.448 ↓ 0.0 0 96

Bitmap Heap Scan on checklist_realizado_item cri1_5 (cost=30.12..34.14 rows=1 width=44) (actual time=0.463..0.463 rows=0 loops=96)

  • Recheck Cond: (((id_checklist_realizado_secao)::text = (crs1_4.id)::text) AND (val_perc_resposta_bp_nota <= '0'::double precision))
147. 0.768 43.968 ↓ 0.0 0 96

BitmapAnd (cost=30.12..30.12 rows=1 width=0) (actual time=0.458..0.458 rows=0 loops=96)

148. 4.320 4.320 ↑ 1.7 24 96

Bitmap Index Scan on checklist_realizado_item_secao_idx (cost=0.00..4.86 rows=40 width=0) (actual time=0.045..0.045 rows=24 loops=96)

  • Index Cond: ((id_checklist_realizado_secao)::text = (crs1_4.id)::text)
149. 38.880 38.880 ↑ 1.0 1,087 96

Bitmap Index Scan on check_real_item_perc_bp_nota_idx (cost=0.00..24.74 rows=1,107 width=0) (actual time=0.405..0.405 rows=1,087 loops=96)

  • Index Cond: (val_perc_resposta_bp_nota <= '0'::double precision)
150. 1.152 12.960 ↑ 1.0 1 96

Aggregate (cost=1,192.38..1,192.41 rows=1 width=8) (actual time=0.134..0.135 rows=1 loops=96)

151. 1.728 11.808 ↑ 1.7 24 96

Nested Loop (cost=1.12..1,192.28 rows=40 width=8) (actual time=0.091..0.123 rows=24 loops=96)

152. 4.224 4.224 ↑ 7.0 1 96

Index Scan using checklist_realizado_secao_checklist_idx on checklist_realizado_secao crs1_5 (cost=0.56..32.68 rows=7 width=36) (actual time=0.043..0.044 rows=1 loops=96)

  • Index Cond: ((id_checklist_realizado)::text = (cr.id)::text)
153. 5.856 5.856 ↑ 1.7 24 96

Index Scan using checklist_realizado_item_secao_idx on checklist_realizado_item cri1_6 (cost=0.56..165.26 rows=40 width=44) (actual time=0.039..0.061 rows=24 loops=96)

  • Index Cond: ((id_checklist_realizado_secao)::text = (crs1_5.id)::text)
154. 1.344 14.976 ↓ 0.0 0 96

Bitmap Heap Scan on checklist_plano cp (cost=9.14..13.15 rows=1 width=0) (actual time=0.156..0.156 rows=0 loops=96)

  • Recheck Cond: (((id_checklist)::text = (c.id)::text) AND ((id_plano_qualidade)::text = (pq.id)::text))
  • Filter: (flg_obriga_verificacao IS TRUE)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=96
155. 1.056 13.632 ↓ 0.0 0 96

BitmapAnd (cost=9.14..9.14 rows=1 width=0) (actual time=0.142..0.142 rows=0 loops=96)

156. 5.472 5.472 ↓ 1.2 6 96

Bitmap Index Scan on checklist_plano_id_checklist_idx (cost=0.00..4.33 rows=5 width=0) (actual time=0.057..0.057 rows=6 loops=96)

  • Index Cond: ((id_checklist)::text = (c.id)::text)
157. 7.104 7.104 ↓ 4.6 164 96

Bitmap Index Scan on checklist_plano_id_plano_qualidade_idx (cost=0.00..4.56 rows=36 width=0) (actual time=0.074..0.074 rows=164 loops=96)

  • Index Cond: ((id_plano_qualidade)::text = (pq.id)::text)
158. 0.000 0.000 ↓ 0.0 0

Seq Scan on checklist_plano cp_1 (cost=0.00..990.46 rows=1,357 width=64) (never executed)

  • Filter: (flg_obriga_verificacao IS TRUE)
159. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.15..11.43 rows=1 width=0) (never executed)

  • Join Filter: ((pqe.id)::text = (cpe.id_plano_qualidade_empresa)::text)
160. 0.000 0.000 ↓ 0.0 0

Index Scan using plano_qualidade_empresa_id_empresa_idx on plano_qualidade_empresa pqe (cost=0.15..8.17 rows=1 width=13) (never executed)

  • Index Cond: ((id_empresa)::text = 'RKKIHSQDCNHI'::text)
161. 0.000 0.000 ↓ 0.0 0

Seq Scan on checklist_plano_empresa cpe (cost=0.00..3.25 rows=1 width=146) (never executed)

  • Filter: ((flg_obriga_verificacao IS TRUE) AND ((id_checklist)::text = (c.id)::text))
162. 0.010 0.096 ↓ 0.0 0 1

Hash Join (cost=8.18..11.31 rows=1 width=32) (actual time=0.096..0.096 rows=0 loops=1)

  • Hash Cond: ((cpe_1.id_plano_qualidade_empresa)::text = (pqe_1.id)::text)
163. 0.043 0.043 ↑ 25.0 2 1

Seq Scan on checklist_plano_empresa cpe_1 (cost=0.00..3.00 rows=50 width=292) (actual time=0.029..0.043 rows=2 loops=1)

  • Filter: (flg_obriga_verificacao IS TRUE)
  • Rows Removed by Filter: 50
164. 0.010 0.043 ↑ 1.0 1 1

Hash (cost=8.17..8.17 rows=1 width=13) (actual time=0.043..0.043 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
165. 0.033 0.033 ↑ 1.0 1 1

Index Scan using plano_qualidade_empresa_id_empresa_idx on plano_qualidade_empresa pqe_1 (cost=0.15..8.17 rows=1 width=13) (actual time=0.032..0.033 rows=1 loops=1)

  • Index Cond: ((id_empresa)::text = 'RKKIHSQDCNHI'::text)