explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pCmV : Optimization for: plan #4w4Z1

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.005 5,162.802 ↑ 1.0 10 1

Limit (cost=21,750.83..21,750.85 rows=10 width=1,305) (actual time=5,162.798..5,162.802 rows=10 loops=1)

2. 52.423 5,162.797 ↑ 77.1 10 1

Sort (cost=21,750.83..21,752.75 rows=771 width=1,305) (actual time=5,162.796..5,162.797 rows=10 loops=1)

  • Sort Key: (ts_rank(content_cards.ementa_vectors, query.query, 32)) DESC, content_cards.id
  • Sort Method: top-N heapsort Memory: 39kB
3. 246.773 5,110.374 ↓ 83.5 64,344 1

Nested Loop (cost=844.14..21,734.17 rows=771 width=1,305) (actual time=363.989..5,110.374 rows=64,344 loops=1)

4. 0.019 0.019 ↑ 1.0 1 1

Function Scan on to_tsquery query (cost=0.25..0.26 rows=1 width=32) (actual time=0.018..0.019 rows=1 loops=1)

5. 4,507.785 4,863.582 ↓ 83.5 64,344 1

Bitmap Heap Scan on content_cards (cost=843.89..21,724.27 rows=771 width=1,456) (actual time=363.960..4,863.582 rows=64,344 loops=1)

  • Recheck Cond: (query.query @@ ementa_vectors)
  • Rows Removed by Index Recheck: 513045
  • Filter: ((data_publicacao >= '2010-01-01'::date) AND (data_publicacao <= '2020-01-30'::date) AND (ts_rank(ementa_vectors, query.query, 32) > '0.001'::double precision) AND (entity = ANY ('{7,0,3,1,2}'::integer[])))
  • Rows Removed by Filter: 62313
  • Heap Blocks: exact=32393 lossy=132847
6. 355.797 355.797 ↓ 44.7 258,130 1

Bitmap Index Scan on ementa_vecs (cost=0.00..843.70 rows=5,772 width=0) (actual time=355.797..355.797 rows=258,130 loops=1)

  • Index Cond: (query.query @@ ementa_vectors)