Re: integer[] indexing.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dawid Kuroczko <qnex42(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: integer[] indexing.
Date: 2004-10-08 14:03:26
Message-ID: 11972.1097244206@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Dawid Kuroczko <qnex42(at)gmail(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-10-08 14:22:44 Re: Re: Re: Data warehousing requirements
Previous Message Tom Lane 2004-10-08 13:55:56 Re: [PERFORM] stats on cursor and query execution troubleshooting