explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ArU6

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 14,510.212 ↑ 1.0 35 1

Limit (cost=489,577.47..489,581.66 rows=35 width=163) (actual time=14,510.200..14,510.212 rows=35 loops=1)

  • Output: doc.id_documento, doc.id_documento_guid, doc.id_carater, doc.id_prioridade, doc.dt_protocolo_central, doc.co_tipo_documento, doc.nu_protocolo_central, doc.ds_posto, doc.id_unidade_administrativa, doc.co_recebido_expedido, doc.co_categoria, doc.ds (...)
  • Buffers: shared hit=719746 read=130965
2. 67.242 14,545.174 ↑ 36,427.3 36 1

Gather Merge (cost=489,577.35..646,595.44 rows=1,311,384 width=163) (actual time=14,510.196..14,545.174 rows=36 loops=1)

  • Output: doc.id_documento, doc.id_documento_guid, doc.id_carater, doc.id_prioridade, doc.dt_protocolo_central, doc.co_tipo_documento, doc.nu_protocolo_central, doc.ds_posto, doc.id_unidade_administrativa, doc.co_recebido_expedido, doc.co_categoria, (...)
  • Workers Planned: 4
  • Workers Launched: 4
  • Buffers: shared hit=3682111 read=647528
3. 11.552 14,477.932 ↑ 10,575.7 31 5 / 5

Sort (cost=488,577.29..489,396.90 rows=327,846 width=163) (actual time=14,477.929..14,477.932 rows=31 loops=5)

  • Output: doc.id_documento, doc.id_documento_guid, doc.id_carater, doc.id_prioridade, doc.dt_protocolo_central, doc.co_tipo_documento, doc.nu_protocolo_central, doc.ds_posto, doc.id_unidade_administrativa, doc.co_recebido_expedido, doc.co_categ (...)
  • Sort Key: (ts_rank(ex.ts_vector_fts, '''cor'''::tsquery)) DESC
  • Sort Method: top-N heapsort Memory: 39kB
  • Worker 0: Sort Method: top-N heapsort Memory: 40kB
  • Worker 1: Sort Method: top-N heapsort Memory: 39kB
  • Worker 2: Sort Method: top-N heapsort Memory: 38kB
  • Worker 3: Sort Method: top-N heapsort Memory: 39kB
  • Buffers: shared hit=3682111 read=647528
  • Worker 0: actual time=14470.044..14470.046 rows=36 loops=1
  • Buffers: shared hit=796559 read=136072
  • Worker 1: actual time=14469.981..14469.984 rows=36 loops=1
  • Buffers: shared hit=684876 read=122434
  • Worker 2: actual time=14470.035..14470.037 rows=36 loops=1
  • Buffers: shared hit=706232 read=125709
  • Worker 3: actual time=14470.034..14470.037 rows=36 loops=1
  • Buffers: shared hit=774698 read=132348
4. 38.949 14,466.380 ↑ 68.6 4,778 5 / 5

Nested Loop (cost=0.42..478,463.36 rows=327,846 width=163) (actual time=206.941..14,466.380 rows=4,778 loops=5)

  • Output: doc.id_documento, doc.id_documento_guid, doc.id_carater, doc.id_prioridade, doc.dt_protocolo_central, doc.co_tipo_documento, doc.nu_protocolo_central, doc.ds_posto, doc.id_unidade_administrativa, doc.co_recebido_expedido, doc.co (...)
  • Buffers: shared hit=3682084 read=647527
  • Worker 0: actual time=511.097..14457.745 rows=4965 loops=1
  • Buffers: shared hit=796552 read=136072
  • Worker 1: actual time=9.061..14457.881 rows=4612 loops=1
  • Buffers: shared hit=684869 read=122434
  • Worker 2: actual time=9.051..14457.920 rows=4626 loops=1
  • Buffers: shared hit=706225 read=125709
  • Worker 3: actual time=503.435..14457.703 rows=4921 loops=1
  • Buffers: shared hit=774692 read=132347
5. 1.463 12,277.511 ↓ 2.9 4,778 5 / 5

Parallel Append (cost=0.00..470,358.40 rows=1,627 width=287) (actual time=203.298..12,277.511 rows=4,778 loops=5)

  • Buffers: shared hit=3437069 read=626344
  • Worker 0: actual time=510.588..12018.539 rows=4965 loops=1
  • Buffers: shared hit=746079 read=131481
  • Worker 1: actual time=1.328..12413.822 rows=4612 loops=1
  • Buffers: shared hit=637451 read=118418
  • Worker 2: actual time=1.091..12544.361 rows=4626 loops=1
  • Buffers: shared hit=658598 read=121736
  • Worker 3: actual time=501.462..11900.558 rows=4921 loops=1
  • Buffers: shared hit=724462 read=127862
6. 2,839.547 2,839.547 ↓ 7.2 2,984 2 / 5

Parallel Index Scan using tb_documento_expediente_p_y2011_pkey on comunicacao.tb_documento_expediente_p_y2011 ex (cost=0.42..202,868.23 rows=416 width=308) (actual time=506.023..7,098.867 rows=2,984 loops=2)

  • Output: ex.ts_vector_fts, ex.id_documento_expediente
  • Index Cond: ((ex.dt_protocolo_central >= '2011-01-01 00:00:00'::timestamp without time zone) AND (ex.dt_protocolo_central <= '2014-12-31 00:00:00'::timestamp without time zone))
  • Filter: (ex.ts_vector_fts @@ '''cor'''::tsquery)
  • Rows Removed by Filter: 166528
  • Buffers: shared hit=910490 read=147682
  • Worker 0: actual time=510.586..7146.548 rows=3023 loops=1
  • Buffers: shared hit=465366 read=75927
  • Worker 3: actual time=501.460..7051.187 rows=2944 loops=1
  • Buffers: shared hit=445124 read=71755
7. 9,436.501 9,436.501 ↓ 3.0 3,584 5 / 5

Parallel Seq Scan on comunicacao.tb_documento_expediente_p_y2014 ex_1 (cost=0.00..267,482.04 rows=1,211 width=280) (actual time=1.252..9,436.501 rows=3,584 loops=5)

  • Output: ex_1.ts_vector_fts, ex_1.id_documento_expediente
  • Filter: ((ex_1.ts_vector_fts @@ '''cor'''::tsquery) AND (ex_1.dt_protocolo_central >= '2011-01-01 00:00:00'::timestamp without time zone) AND (ex_1.dt_protocolo_central <= '2014-12-31 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 190832
  • Buffers: shared hit=2526579 read=478662
  • Worker 0: actual time=1.651..4870.506 rows=1942 loops=1
  • Buffers: shared hit=280713 read=55554
  • Worker 1: actual time=1.326..12412.508 rows=4612 loops=1
  • Buffers: shared hit=637451 read=118418
  • Worker 2: actual time=1.090..12542.921 rows=4626 loops=1
  • Buffers: shared hit=658598 read=121736
  • Worker 3: actual time=0.172..4847.868 rows=1977 loops=1
  • Buffers: shared hit=279338 read=56107
8. 9.555 2,149.920 ↑ 2.0 1 23,888 / 5

Append (cost=0.42..4.46 rows=2 width=159) (actual time=0.449..0.450 rows=1 loops=23,888)

  • Buffers: shared hit=146209 read=21183
  • Worker 0: actual time=0.481..0.483 rows=1 loops=4965
  • Buffers: shared hit=30203 read=4591
  • Worker 1: actual time=0.434..0.435 rows=1 loops=4612
  • Buffers: shared hit=28306 read=4016
  • Worker 2: actual time=0.405..0.405 rows=1 loops=4626
  • Buffers: shared hit=28446 read=3973
  • Worker 3: actual time=0.509..0.512 rows=1 loops=4921
  • Buffers: shared hit=29993 read=4485
9. 640.198 640.198 ↓ 0.0 0 23,888 / 5

Index Scan using tb_documento_p_y2011_pkey on comunicacao.tb_documento_p_y2011 doc (cost=0.42..2.23 rows=1 width=160) (actual time=0.134..0.134 rows=0 loops=23,888)

  • Output: doc.id_documento, doc.id_documento_guid, doc.id_carater, doc.id_prioridade, doc.dt_protocolo_central, doc.co_tipo_documento, doc.nu_protocolo_central, doc.ds_posto, doc.id_unidade_administrativa, doc.co_recebido_expe (...)
  • Index Cond: ((doc.id_documento = ex.id_documento_expediente) AND (doc.dt_protocolo_central >= '2011-01-01 00:00:00'::timestamp without time zone) AND (doc.dt_protocolo_central <= '2014-12-31 00:00:00'::timestamp without time (...)
  • Buffers: shared hit=72283 read=5397
  • Worker 0: actual time=0.307..0.307 rows=1 loops=4965
  • Buffers: shared hit=15182 read=2763
  • Worker 1: actual time=0.005..0.005 rows=0 loops=4612
  • Buffers: shared hit=13837
  • Worker 2: actual time=0.004..0.004 rows=0 loops=4626
  • Buffers: shared hit=13878 read=1
  • Worker 3: actual time=0.329..0.329 rows=1 loops=4921
  • Buffers: shared hit=15094 read=2633
10. 1,500.166 1,500.166 ↑ 1.0 1 23,888 / 5

Index Scan using tb_documento_p_y2014_pkey on comunicacao.tb_documento_p_y2014 doc_1 (cost=0.42..2.22 rows=1 width=159) (actual time=0.314..0.314 rows=1 loops=23,888)

  • Output: doc_1.id_documento, doc_1.id_documento_guid, doc_1.id_carater, doc_1.id_prioridade, doc_1.dt_protocolo_central, doc_1.co_tipo_documento, doc_1.nu_protocolo_central, doc_1.ds_posto, doc_1.id_unidade_administrativa, do (...)
  • Index Cond: ((doc_1.id_documento = ex.id_documento_expediente) AND (doc_1.dt_protocolo_central >= '2011-01-01 00:00:00'::timestamp without time zone) AND (doc_1.dt_protocolo_central <= '2014-12-31 00:00:00'::timestamp withou (...)
  • Buffers: shared hit=73926 read=15786
  • Worker 0: actual time=0.175..0.175 rows=0 loops=4965
  • Buffers: shared hit=15021 read=1828
  • Worker 1: actual time=0.428..0.429 rows=1 loops=4612
  • Buffers: shared hit=14469 read=4016
  • Worker 2: actual time=0.399..0.399 rows=1 loops=4626
  • Buffers: shared hit=14568 read=3972
  • Worker 3: actual time=0.181..0.181 rows=0 loops=4921
  • Buffers: shared hit=14899 read=1852
Planning time : 17.721 ms
Execution time : 14,545.262 ms