explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QhGY

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.004 217,550.572 ↑ 1.0 35 1

Limit (cost=110,985.13..110,985.21 rows=35 width=154) (actual time=217,550.568..217,550.572 rows=35 loops=1)

  • Buffers: shared hit=289334 read=70529
2. 46.120 217,550.568 ↑ 199.0 36 1

Sort (cost=110,985.12..111,003.03 rows=7,163 width=154) (actual time=217,550.566..217,550.568 rows=36 loops=1)

  • Sort Key: (ts_rank(ex.ts_vector_fts, '''guerr'''::tsquery)) DESC
  • Sort Method: top-N heapsort Memory: 36kB
  • Buffers: shared hit=289334 read=70529
3. 93,805.116 217,504.448 ↓ 1.7 12,126 1

Nested Loop (cost=274.57..110,764.15 rows=7,163 width=154) (actual time=34,473.783..217,504.448 rows=12,126 loops=1)

  • Buffers: shared hit=289334 read=70529
4. 315.246 329.615 ↓ 1.9 62,529 1

Bitmap Heap Scan on tb_documento_expediente ex (cost=274.14..36,018.05 rows=32,818 width=364) (actual time=23.453..329.615 rows=62,529 loops=1)

  • Recheck Cond: (ts_vector_fts @@ '''guerr'''::tsquery)
  • Heap Blocks: exact=57672
  • Buffers: shared hit=57699
5. 14.369 14.369 ↓ 1.9 62,529 1

Bitmap Index Scan on ind_documento_expediente_ts_vector_fts (cost=0.00..265.93 rows=32,818 width=0) (actual time=14.369..14.369 rows=62,529 loops=1)

  • Index Cond: (ts_vector_fts @@ '''guerr'''::tsquery)
  • Buffers: shared hit=27
6. 123,369.717 123,369.717 ↓ 0.0 0 62,529

Index Scan using pk_tb_documento on tb_documento doc (cost=0.43..2.28 rows=1 width=150) (actual time=1.973..1.973 rows=0 loops=62,529)

  • Index Cond: (id_documento = ex.id_documento)
  • Filter: ((dt_protocolo_central >= '2010-01-01 00:00:00'::timestamp without time zone) AND (dt_protocolo_central <= '2013-12-31 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=199947 read=50480
Planning time : 67.869 ms
Execution time : 217,550.694 ms