Extra cost of "lossy mode" Bitmap Scan plan

Поиск
Список
Период
Сортировка
От higepon
Тема Extra cost of "lossy mode" Bitmap Scan plan
Дата
Msg-id f07386410904272233u452e1bf2n81b187f974fe5e81@mail.gmail.com
обсуждение исходный текст
Ответы Re: Extra cost of "lossy mode" Bitmap Scan plan  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Список pgsql-hackers
Hi.

I found the current planner doesn't care about "lossy mode" on Bitmap Scan.
I think costs of following two plans are equal now.

(a) Having enough work_mem => normal Bitmap Scan.

(b) Having less work_mem than estimated rows => Bitmap Scan with "lossy mode".   Slower than (a).

So, sometimes the planner makes a wrong choice.
For example, on some queries the planner doesn't choose a faster Index Scan plan
but a much slower Bitmap Scan (in actually lossy).

My understanding is that we can know whether the plan is lossy or not
like following.
int tbm_maxentries = work_mem * 1024L;if (estimatedNumLows < tbm_maxentries) {   /* not lossy */} else {   /* lossy :
wemay add some extra costs to total costs */}
 

Any ideas how to do this?

Best regards,

-----
MINOWA Taro (Higepon)

Cybozu Labs, Inc.

http://www.monaos.org/
http://code.google.com/p/mosh-scheme/


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Clean shutdown and warm standby
Следующее
От: Itagaki Takahiro
Дата:
Сообщение: Re: Extra cost of "lossy mode" Bitmap Scan plan