Re: integer[] indexing. - Mailing list pgsql-performance

From Tom Lane
Subject Re: integer[] indexing.
Date
Msg-id 11972.1097244206@sss.pgh.pa.us
Whole thread Raw
In response to integer[] indexing.  (Dawid Kuroczko <qnex42@gmail.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: [pgsql-benchmarks] stats on cursor and query execution troubleshooting
Next
From: Tom Lane
Date:
Subject: Re: Re: Re: Data warehousing requirements