pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jordi <jmaillists@promani.be>
Cc: pgsql-performance@postgresql.org
Subject: Re: Bitmap and-ing between btree and gin?
Date: Thu, 04 Feb 2016 11:08:41 -0500
Message-ID: <17855.1454602121@sss.pgh.pa.us> (raw)
In-Reply-To: <56B332B6.1040109@promani.be>
References: <56B332B6.1040109@promani.be>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Jordi <jmaillists@promani.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


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (4+ messages)  latest in thread

Message-ID: <17855.1454602121@sss.pgh.pa.us>
Permalink:  ../17855.1454602121@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17855.1454602121@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jmaillists@promani.be
  Subject: Re: Bitmap and-ing between btree and gin?
  In-Reply-To: <17855.1454602121@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox