Re: Bitmap index scans use of filters on available columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bitmap index scans use of filters on available columns
Дата
Msg-id 1799.1446650071@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Bitmap index scans use of filters on available columns  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Bitmap index scans use of filters on available columns
Re: Bitmap index scans use of filters on available columns
Список pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> On 4 November 2015 at 15:54, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> We generate this plan
>  Index Scan using f_x_y_idx on f  (cost=0.42..26075.71 rows=209 width=37)
>    Index Cond: (x = 5)
>    Filter: (y ~~ '%abc%'::text)

> So it should be possible to do the Filter condition on the BitmapIndexScan.

You're missing my point: that is possible in an indexscan, but *not* in a
bitmap indexscan, because the index AM APIs are totally different in the
two cases.  In a bitmap scan, nothing more than a TID bitmap is ever
returned out to anyplace that could execute arbitrary expressions.

In the case at hand, the planner should have considered a plan of this
shape as well.  Presumably it concluded it was more expensive than using
the bitmap approach.  Jeff might try "set enable_bitmapscan = 0" and
compare the estimated and actual costs.
        regards, tom lane



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

Предыдущее
От: Kouhei Kaigai
Дата:
Сообщение: Re: CustomScan support on readfuncs.c
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: extend pgbench expressions with functions