explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0EDy : Optimization for: plan #QhGY

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.005 464.491 ↑ 1.0 35 1

Limit (cost=110,985.13..110,985.21 rows=35 width=154) (actual time=464.486..464.491 rows=35 loops=1)

  • Buffers: shared hit=359863
2. 5.463 464.486 ↑ 199.0 36 1

Sort (cost=110,985.12..111,003.03 rows=7,163 width=154) (actual time=464.483..464.486 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=359863
3. 120.479 459.023 ↓ 1.7 12,126 1

Nested Loop (cost=274.57..110,764.15 rows=7,163 width=154) (actual time=70.488..459.023 rows=12,126 loops=1)

  • Buffers: shared hit=359863
4. 131.013 150.957 ↓ 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=32.087..150.957 rows=62,529 loops=1)

  • Recheck Cond: (ts_vector_fts @@ '''guerr'''::tsquery)
  • Heap Blocks: exact=57672
  • Buffers: shared hit=57699
5. 19.944 19.944 ↓ 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=19.944..19.944 rows=62,529 loops=1)

  • Index Cond: (ts_vector_fts @@ '''guerr'''::tsquery)
  • Buffers: shared hit=27
6. 187.587 187.587 ↓ 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=0.003..0.003 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=250427
Planning time : 0.461 ms
Execution time : 464.567 ms