Re: No Index-Only Scan on Partial Index

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: No Index-Only Scan on Partial Index
Дата
Msg-id 76BCA8DC-048A-4631-A004-CBB152EE7FA0@justatheory.com
обсуждение исходный текст
Ответ на Re: No Index-Only Scan on Partial Index  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: No Index-Only Scan on Partial Index  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
On Oct 1, 2013, at 3:56 PM, Merlin Moncure <mmoncure@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?

Best,

David




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: No Index-Only Scan on Partial Index
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: insert throw error when year field len > 4 for timestamptz datatype