pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <greg@2ndQuadrant.com>
To: pgsql-performance@postgresql.org
Subject: Re: bitmask index
Date: Wed, 22 Jun 2011 17:42:25 -0400
Message-ID: <4E0261C1.8000807@2ndQuadrant.com> (raw)
In-Reply-To: <4E025E54.6020402@engene.se>
References: <4E025E54.6020402@engene.se>

On 06/22/2011 05:27 PM, Marcus Engene wrote:
> I have some tables with bitmask integers. Set bits are the interesting 
> ones. Usually they are sparse.

If it's sparse, create a partial index that just includes rows where the 
bit is set:  
http://www.postgresql.org/docs/current/static/indexes-partial.html

You need to be careful the query uses the exact syntax as the one that 
created the index for it to be used.  But if you do that, it should be 
able to pull the rows that match out quickly.

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books




view thread (5+ messages)  latest in thread

Message-ID: <4E0261C1.8000807@2ndQuadrant.com>
Permalink:  ../4E0261C1.8000807@2ndQuadrant.com/
Also on:    postgresql.org/message-id/4E0261C1.8000807@2ndQuadrant.com

 · 

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: greg@2ndQuadrant.com
  Subject: Re: bitmask index
  In-Reply-To: <4E0261C1.8000807@2ndQuadrant.com>

* 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