Re: How to avoid a GIN recheck condition

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexis <alexis(at)bernard(dot)io>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to avoid a GIN recheck condition
Date: 2014-11-24 15:29:47
Message-ID: 23047.1416842987@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexis <alexis(at)bernard(dot)io> writes:
> I have a GIN index but the planner rechecks the condition. When many rows
> are foud in the index that is very slow:

You're assuming a fact not in evidence, namely that the recheck condition
is being used at runtime. The planner will *always* attach a recheck
condition to a bitmap heap scan, but it only gets used if
(1) the index opclass reports that its result is lossy, or
(2) the bitmap bloats to the point where it has to be stored lossily.

I see no weights in your query so (1) isn't happening, and it seems
unlikely that (2) is happening if the rowcount estimate is on target.
Lacking EXPLAIN ANALYZE results, it's hard to speculate further.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message François Beausoleil 2014-11-24 15:50:08 Re: How to individually list the DDL for all individual data base objects
Previous Message Berend Tober 2014-11-24 15:14:15 How to individually list the DDL for all individual data base objects