pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dawid Kuroczko <qnex42@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: integer[] indexing.
Date: Fri, 08 Oct 2004 10:03:26 -0400
Message-ID: <11972.1097244206@sss.pgh.pa.us> (raw)
In-Reply-To: <758d5e7f041008021163fb40eb@mail.gmail.com>
References: <758d5e7f041008021163fb40eb@mail.gmail.com>

Dawid Kuroczko <qnex42@gmail.com> writes:
> But when I phrase the query:

> SELECT * FROM table WHERE (icount(ids) <= 1 AND ids[1] = 33) OR
> (icount(ids) > 1 AND ids && '{33}');

> Planner insists on using seqscan.  Even with enable_seqscan = off;

The OR-index-scan mechanism isn't currently smart enough to use partial
indexes that are only valid for some of the OR'd clauses rather than all
of them.  Feel free to fix it ;-).  (This might not even be very hard;
I haven't looked.)

			regards, tom lane



view thread (4+ messages)

Message-ID: <11972.1097244206@sss.pgh.pa.us>
Permalink:  ../11972.1097244206@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11972.1097244206@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, qnex42@gmail.com
  Subject: Re: integer[] indexing.
  In-Reply-To: <11972.1097244206@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