Re: Bitmap and-ing between btree and gin?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jordi <jmaillists(at)promani(dot)be>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Bitmap and-ing between btree and gin?
Date: 2016-02-04 16:08:41
Message-ID: 17855.1454602121@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jordi <jmaillists(at)promani(dot)be> writes:
> I've been trying to get a query use indexes and it has raised a doubt
> whether pgsql supports bitmap and-ing between a multi-column btree index
> and a gin index.

Sure. But such a plan would give an unordered result, meaning that we'd
have to process the whole table before doing the ORDER BY/LIMIT. The
planner evidently thinks that it's better to try to process the rows in
ID order so it can stop as soon as it's got 100. If it's wrong about
that, that's likely because it's got a bad estimate of the selectivity of
the other WHERE conditions. You might see if you can improve the
statistics for the search_vector column.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jordi 2016-02-04 17:19:31 Re: Bitmap and-ing between btree and gin?
Previous Message Jordi 2016-02-04 11:15:02 Bitmap and-ing between btree and gin?