explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Y6O

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=3,516.72..3,516.76 rows=15 width=502) (actual rows= loops=)

  • Sort Key: autorizacao_anterior.data_cadastro
2. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3,516.06..3,516.43 rows=15 width=502) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=649.71..3,513.51 rows=34 width=502) (actual rows= loops=)

  • Join Filter: (((autorizacao_anterior.gc_ordem_id)::text = '0C7225A4458A4F3EA5F98E6FF6F5896B'::text) AND (((btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)) = btrim(replace(upper(regexp_replace(translate((aluno.nome)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text))) AND (regexp_replace(btrim((autorizacao_anterior.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text) = regexp_replace(btrim((aluno.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text)) AND ((autorizacao_anterior.data_nascimento)::date = (aluno.date_nasc)::date)) OR ((btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)) = btrim(replace(upper(regexp_replace(translate((aluno.nome)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text))) AND (regexp_replace(btrim((autorizacao_anterior.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text) = regexp_replace(btrim((aluno.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text))) OR ((btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)) = btrim(replace(upper(regexp_replace(translate((aluno.nome)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text))) AND ((autorizacao_anterior.data_nascimento)::date = (aluno.date_nasc)::date)) OR (("substring"(replace(btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)), ' '::text, ''::text), 1, 5) = "substring"(replace(btrim(replace(upper(regexp_replace(translate((aluno.nome)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)), ' '::text, ''::text), 1, 5)) AND (regexp_replace(btrim((autorizacao_anterior.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text) = regexp_replace(btrim((aluno.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text))) OR (btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)) = btrim(replace(upper(regexp_replace(translate((aluno.nome)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)))))
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=7.49..74.46 rows=15 width=493) (actual rows= loops=)

  • Join Filter: (((btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)) = btrim(replace(upper(regexp_replace(translate((autorizacao_atual.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text))) AND (regexp_replace(btrim((autorizacao_anterior.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text) = regexp_replace(btrim((autorizacao_atual.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text)) AND ((autorizacao_anterior.data_nascimento)::date = (autorizacao_atual.data_nascimento)::date)) OR ((btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)) = btrim(replace(upper(regexp_replace(translate((autorizacao_atual.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text))) AND (regexp_replace(btrim((autorizacao_anterior.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text) = regexp_replace(btrim((autorizacao_atual.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text))) OR ((btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)) = btrim(replace(upper(regexp_replace(translate((autorizacao_atual.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text))) AND ((autorizacao_anterior.data_nascimento)::date = (autorizacao_atual.data_nascimento)::date)) OR (("substring"(replace(btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)), ' '::text, ''::text), 1, 5) = "substring"(replace(btrim(replace(upper(regexp_replace(translate((autorizacao_atual.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)), ' '::text, ''::text), 1, 5)) AND (regexp_replace(btrim((autorizacao_anterior.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text) = regexp_replace(btrim((autorizacao_atual.num_matricula)::text, '0'::text), '[^a-zA-Z0-9]'::text, ''::text, 'g'::text))) OR (btrim(replace(upper(regexp_replace(translate((autorizacao_anterior.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text)) = btrim(replace(upper(regexp_replace(translate((autorizacao_atual.nome_aluno)::text, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ'::text, 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY'::text), '[^a-zA-Z ]'::text, ''::text, 'g'::text)), ' '::text, ' '::text))))
5. 0.000 0.000 ↓ 0.0

Seq Scan on gsi_autorizacao autorizacao_anterior (cost=0.00..7.57 rows=15 width=460) (actual rows= loops=)

  • Filter: (((status_promocao IS NULL) OR ((status_promocao)::text <> 'PR'::text)) AND ((gc_ordem_id)::text = '0C7225A4458A4F3EA5F98E6FF6F5896B'::text))
6. 0.000 0.000 ↓ 0.0

Materialize (cost=7.49..7.67 rows=18 width=71) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Seq Scan on gsi_autorizacao autorizacao_atual (cost=0.00..7.47 rows=18 width=71) (actual rows= loops=)

  • Filter: ((gc_ordem_id)::text = '6615FE07A0B1406E9955137D1E018068'::text)
8. 0.000 0.000 ↓ 0.0

Materialize (cost=642.22..650.60 rows=838 width=48) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Seq Scan on gd_pessoa aluno (cost=0.00..641.38 rows=838 width=48) (actual rows= loops=)

  • Filter: (((gc_ordem_id)::text = '6615FE07A0B1406E9955137D1E018068'::text) AND ((type)::text = 'AL'::text))