pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Kretschmer <akretschmer@spamfence.net>
Cc: Huang, Suya <Suya.Huang@au.experian.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: GIN index not used
Date: Fri, 11 Jul 2014 00:56:14 -0400
Message-ID: <20680.1405054574@sss.pgh.pa.us> (raw)
In-Reply-To: <20140711044452.GA7390@tux>
References: <D83E55F5F4D99B4A9B4C4E259E6227CD014C3263@AUX1EXC01.apac.experian.local>
	<20140711044452.GA7390@tux>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Andreas Kretschmer <akretschmer@spamfence.net> writes:
> Huang, Suya <Suya.Huang@au.experian.com> wrote:
>> I’ve got a table with GIN index on integer[] type. While doing a query with
>> filter criteria on that column has GIN index created, it’s not using index at
>> all, still do the full table scan. Wondering why?

> Btw.: works for me:

Yeah, me too:

regression=# create table booking_weekly(booking_ts int[]);
CREATE TABLE
regression=# create index on booking_weekly using gin (booking_ts);
CREATE INDEX
regression=# explain select * from booking_weekly where booking_ts@>array[2446685];
                                         QUERY PLAN                                         
--------------------------------------------------------------------------------------------
 Bitmap Heap Scan on booking_weekly  (cost=8.05..18.20 rows=7 width=32)
   Recheck Cond: (booking_ts @> '{2446685}'::integer[])
   ->  Bitmap Index Scan on booking_weekly_booking_ts_idx  (cost=0.00..8.05 rows=7 width=0)
         Index Cond: (booking_ts @> '{2446685}'::integer[])
 Planning time: 0.862 ms
(5 rows)

What PG version is this?  What non-default planner parameter settings are
you using?  (Don't say "none", because I can see you've got enable_seqscan
turned off.)

			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 (8+ messages)  latest in thread

Message-ID: <20680.1405054574@sss.pgh.pa.us>
Permalink:  ../20680.1405054574@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20680.1405054574@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, akretschmer@spamfence.net, Suya.Huang@au.experian.com
  Subject: Re: GIN index not used
  In-Reply-To: <20680.1405054574@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