explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8Lac

Settings
# exclusive inclusive rows x rows loops node
1. 0.060 19,467.333 ↑ 1.0 35 1

Limit (cost=4,389.56..5,843.04 rows=35 width=481) (actual time=1,802.413..19,467.333 rows=35 loops=1)

  • Buffers: shared hit=10,720 read=796
2. 1,369.832 19,467.273 ↑ 35.2 140 1

Nested Loop Left Join (cost=29.13..204,678.74 rows=4,928 width=481) (actual time=48.322..19,467.273 rows=140 loops=1)

  • Buffers: shared hit=10,720 read=796
3. 0.271 17,196.401 ↑ 35.2 140 1

Nested Loop Left Join (cost=26.43..191,188.34 rows=4,928 width=807) (actual time=48.269..17,196.401 rows=140 loops=1)

  • Buffers: shared hit=9,638 read=676
4. 0.183 17,194.730 ↑ 35.2 140 1

Nested Loop Left Join (cost=17.71..148,106.74 rows=4,928 width=775) (actual time=48.256..17,194.730 rows=140 loops=1)

  • Buffers: shared hit=7,958 read=676
5. 0.476 16,391.927 ↑ 35.2 140 1

Nested Loop (cost=8.56..102,828.16 rows=4,928 width=743) (actual time=48.230..16,391.927 rows=140 loops=1)

  • Join Filter: (doc.co_tipo_documento = tipodoc.co_tipo_documento)
  • Rows Removed by Join Filter: 3,788
  • Buffers: shared hit=7,434 read=640
6. 0.127 16,391.171 ↑ 35.2 140 1

Nested Loop (cost=8.56..100,456.81 rows=4,928 width=665) (actual time=48.200..16,391.171 rows=140 loops=1)

  • Buffers: shared hit=7,433 read=640
7. 0.368 16,390.764 ↑ 35.2 140 1

Nested Loop (cost=8.41..94,218.35 rows=4,928 width=587) (actual time=48.193..16,390.764 rows=140 loops=1)

  • Buffers: shared hit=7,153 read=640
8. 3.251 16,389.976 ↑ 35.2 140 1

Nested Loop (cost=8.26..87,979.90 rows=4,928 width=509) (actual time=48.185..16,389.976 rows=140 loops=1)

  • Buffers: shared hit=6,873 read=640
9. 8,479.365 8,479.365 ↑ 22.5 1,460 1

Index Scan using ind_rum_documento_expediente_ts_vector_fts on tb_documento_expediente ex (cost=7.70..36,243.56 rows=32,818 width=362) (actual time=47.933..8,479.365 rows=1,460 loops=1)

  • Index Cond: (ts_vector_fts @@ '''cub'''::tsquery)
  • Order By: (ts_vector_fts <=> '''cub'''::tsquery)
  • Buffers: shared hit=1,286 read=301
10. 7,907.360 7,907.360 ↓ 0.0 0 1,460

Index Only Scan using ind_documento_id_documento_dt_protocolo_central_ic on tb_documento doc (cost=0.56..1.58 rows=1 width=151) (actual time=5.416..5.416 rows=0 loops=1,460)

  • Index Cond: ((id_documento = ex.id_documento) AND (dt_protocolo_central >= '2004-01-01 00:00:00'::timestamp without time zone) AND (dt_protocolo_central <= '2007-12-31 00:00:00'::timestamp without time zone (...)
  • Heap Fetches: 0
  • Buffers: shared hit=5,587 read=339
11. 0.420 0.420 ↑ 1.0 1 140

Index Scan using pk_tb_carater on tb_carater ca (cost=0.15..1.27 rows=1 width=80) (actual time=0.003..0.003 rows=1 loops=140)

  • Index Cond: (id_carater = doc.id_carater)
  • Buffers: shared hit=280
12. 0.280 0.280 ↑ 1.0 1 140

Index Scan using pk_tb_prioridade on tb_prioridade pri (cost=0.15..1.27 rows=1 width=80) (actual time=0.002..0.002 rows=1 loops=140)

  • Index Cond: (id_prioridade = doc.id_prioridade)
  • Buffers: shared hit=280
13. 0.268 0.280 ↑ 1.2 28 140

Materialize (cost=0.00..1.50 rows=33 width=94) (actual time=0.000..0.002 rows=28 loops=140)

  • Buffers: shared hit=1
14. 0.012 0.012 ↑ 1.0 32 1

Seq Scan on tb_tipo_documento tipodoc (cost=0.00..1.33 rows=33 width=94) (actual time=0.009..0.012 rows=32 loops=1)

  • Buffers: shared hit=1
15. 0.700 802.620 ↑ 1.0 1 140

Aggregate (cost=9.16..9.17 rows=1 width=32) (actual time=5.732..5.733 rows=1 loops=140)

  • Buffers: shared hit=524 read=36
16. 801.920 801.920 ↓ 0.0 0 140

Index Scan using ind_documento_distribuicao_id_doc_id_tip_doc_ds_unid_adm_legado on tb_documento_distribuicao docdist (cost=0.56..9.13 rows=11 width=7) (actual time=5.728..5.728 rows=0 loops=140)

  • Index Cond: ((id_documento = doc.id_documento) AND (id_tipo_distribuicao = 1))
  • Buffers: shared hit=524 read=36
17. 0.420 1.400 ↑ 1.0 1 140

Aggregate (cost=8.71..8.72 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=140)

  • Buffers: shared hit=1,680
18. 0.980 0.980 ↓ 0.0 0 140

Index Only Scan using ind_documento_distribuicao_id_doc_id_tip_doc_ds_unid_adm_legado on tb_documento_distribuicao docdistposto (cost=0.56..8.67 rows=7 width=5) (actual time=0.007..0.007 rows=0 loops=140)

  • Index Cond: ((id_documento = doc.id_documento) AND (id_tipo_distribuicao = ANY ('{2,3,4}'::integer[])))
  • Heap Fetches: 0
  • Buffers: shared hit=1,680
19. 0.700 901.040 ↑ 1.0 1 140

Aggregate (cost=2.71..2.71 rows=1 width=32) (actual time=6.436..6.436 rows=1 loops=140)

  • Buffers: shared hit=510 read=52
20. 900.340 900.340 ↑ 1.5 2 140

Index Scan using ind_documento_classificacao_id_documento on tb_documento_classificacao docclas (cost=0.43..2.69 rows=3 width=5) (actual time=6.430..6.431 rows=2 loops=140)

  • Index Cond: (id_documento = doc.id_documento)
  • Buffers: shared hit=510 read=52
Planning time : 1.092 ms
Execution time : 19,468.713 ms