explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5nM4

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 56,196.233 ↑ 1.0 35 1

Limit (cost=489,577.47..489,581.66 rows=35 width=163) (actual time=56,196.220..56,196.233 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=544713 read=116098 written=2243
2. 51.462 56,234.235 ↑ 36,427.3 36 1

Gather Merge (cost=489,577.35..646,595.44 rows=1,311,384 width=163) (actual time=56,196.218..56,234.235 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=3741794 read=588073 written=15569
3. 10.132 56,182.773 ↑ 10,928.2 30 5 / 5

Sort (cost=488,577.29..489,396.90 rows=327,846 width=163) (actual time=56,182.771..56,182.773 rows=30 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: 39kB
  • Worker 1: Sort Method: top-N heapsort Memory: 38kB
  • Worker 2: Sort Method: top-N heapsort Memory: 39kB
  • Worker 3: Sort Method: top-N heapsort Memory: 39kB
  • Buffers: shared hit=3741794 read=588073 written=15569
  • Worker 0: actual time=56176.638..56176.641 rows=36 loops=1
  • Buffers: shared hit=533584 read=115613 written=2299
  • Worker 1: actual time=56177.107..56177.110 rows=36 loops=1
  • Buffers: shared hit=547504 read=115675 written=2232
  • Worker 2: actual time=56176.981..56176.984 rows=36 loops=1
  • Buffers: shared hit=1075941 read=121459 written=4419
  • Worker 3: actual time=56187.839..56187.843 rows=36 loops=1
  • Buffers: shared hit=1040052 read=119228 written=4376
4. 48.938 56,172.641 ↑ 68.6 4,778 5 / 5

Nested Loop (cost=0.42..478,463.36 rows=327,846 width=163) (actual time=36.065..56,172.641 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=3741766 read=588073 written=15569
  • Worker 0: actual time=1.536..56167.580 rows=3645 loops=1
  • Buffers: shared hit=533577 read=115613 written=2299
  • Worker 1: actual time=54.409..56168.519 rows=3841 loops=1
  • Buffers: shared hit=547497 read=115675 written=2232
  • Worker 2: actual time=55.261..56164.949 rows=6392 loops=1
  • Buffers: shared hit=1075934 read=121459 written=4419
  • Worker 3: actual time=66.424..56176.052 rows=6246 loops=1
  • Buffers: shared hit=1040045 read=119228 written=4376
5. 1.816 48,555.985 ↓ 2.9 4,778 5 / 5

Parallel Append (cost=0.00..470,358.40 rows=1,627 width=287) (actual time=31.353..48,555.985 rows=4,778 loops=5)

  • Buffers: shared hit=3495586 read=568055 written=14731
  • Worker 0: actual time=0.580..48047.296 rows=3645 loops=1
  • Buffers: shared hit=496506 read=111822 written=2139
  • Worker 1: actual time=33.089..47512.486 rows=3841 loops=1
  • Buffers: shared hit=508395 read=111826 written=2058
  • Worker 2: actual time=55.200..49836.065 rows=6392 loops=1
  • Buffers: shared hit=1009469 read=117133 written=4242
  • Worker 3: actual time=66.350..49892.323 rows=6246 loops=1
  • Buffers: shared hit=974691 read=115068 written=4227
6. 14,460.263 14,460.263 ↓ 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=60.774..36,150.657 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=1004144 read=54256 written=8134
  • Worker 2: actual time=55.199..36108.832 rows=3066 loops=1
  • Buffers: shared hit=509482 read=27697 written=4049
  • Worker 3: actual time=66.349..36192.482 rows=2901 loops=1
  • Buffers: shared hit=494662 read=26559 written=4085
7. 34,093.906 34,093.906 ↓ 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=22.281..34,093.906 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=2491442 read=513799 written=6597
  • Worker 0: actual time=0.579..48045.412 rows=3645 loops=1
  • Buffers: shared hit=496506 read=111822 written=2139
  • Worker 1: actual time=33.088..47510.812 rows=3841 loops=1
  • Buffers: shared hit=508395 read=111826 written=2058
  • Worker 2: actual time=16.732..13725.216 rows=3326 loops=1
  • Buffers: shared hit=499987 read=89436 written=193
  • Worker 3: actual time=59.461..13697.900 rows=3345 loops=1
  • Buffers: shared hit=480029 read=88509 written=142
8. 14.333 7,567.718 ↑ 2.0 1 23,888 / 5

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

  • Buffers: shared hit=147374 read=20018 written=838
  • Worker 0: actual time=2.215..2.215 rows=1 loops=3645
  • Buffers: shared hit=21745 read=3791 written=160
  • Worker 1: actual time=2.240..2.242 rows=1 loops=3841
  • Buffers: shared hit=23073 read=3849 written=174
  • Worker 2: actual time=0.980..0.982 rows=1 loops=6392
  • Buffers: shared hit=40472 read=4326 written=177
  • Worker 3: actual time=0.995..0.997 rows=1 loops=6246
  • Buffers: shared hit=39600 read=4160 written=149
9. 1,008.074 1,008.074 ↓ 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.211..0.211 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=75550 read=2130 written=303
  • Worker 0: actual time=0.004..0.004 rows=0 loops=3645
  • Buffers: shared hit=10936
  • Worker 1: actual time=0.004..0.004 rows=0 loops=3841
  • Buffers: shared hit=11524
  • Worker 2: actual time=0.394..0.394 rows=0 loops=6392
  • Buffers: shared hit=21160 read=1113 written=164
  • Worker 3: actual time=0.398..0.398 rows=0 loops=6246
  • Buffers: shared hit=20638 read=1017 written=139
10. 6,545.312 6,545.312 ↑ 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=1.370..1.370 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=71824 read=17888 written=535
  • Worker 0: actual time=2.209..2.209 rows=1 loops=3645
  • Buffers: shared hit=10809 read=3791 written=160
  • Worker 1: actual time=2.234..2.235 rows=1 loops=3841
  • Buffers: shared hit=11549 read=3849 written=174
  • Worker 2: actual time=0.586..0.586 rows=1 loops=6392
  • Buffers: shared hit=19312 read=3213 written=13
  • Worker 3: actual time=0.597..0.597 rows=1 loops=6246
  • Buffers: shared hit=18962 read=3143 written=10
Planning time : 1.565 ms
Execution time : 56,234.344 ms