On Tuesday, October 1, 2013, David E. Wheeler <da...@justatheory.com> wrote: > On Oct 1, 2013, at 3:56 PM, Merlin Moncure <mmonc...@gmail.com> wrote: > >> I don't think it has anything to do with the conditional index -- it's >> the functional based. For some reason postgres always wants to post >> filter (note the filter step below): >> >> postgres=# create index on try(upper_inf(irange)); >> CREATE INDEX >> Time: 12.001 ms >> postgres=# explain select * from try where upper_inf(irange); >> QUERY PLAN >> ------------------------------------------------------------------------------- >> Index Scan using try_upper_inf_idx on try (cost=0.00..9.25 rows=33 width=40) >> Index Cond: (upper_inf(irange) = true) >> Filter: upper_inf(irange) > > Hrm. I get a seq scan for that query: > > create index on try(upper_inf(irange)); > explain select * from try where upper_inf(irange); > QUERY PLAN > ----------------------------------------------------------- > Seq Scan on try (cost=0.00..1887.00 rows=33333 width=68) > Filter: upper_inf(irange) > > True also if I just select the irange. Is the filter the issue, here?
Turn off seq scan... merlin