Re: [9.2devel] why it doesn't do index scan only?

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [9.2devel] why it doesn't do index scan only?
Дата
Msg-id CAFj8pRCbRT_vx8quLiAFPc4MKvMSjUGiXhqnYV8MFHBvYAN+uQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [9.2devel] why it doesn't do index scan only?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [9.2devel] why it doesn't do index scan only?
Список pgsql-general
Hello

2011/10/8 Tom Lane <tgl@sss.pgh.pa.us>:
> hubert depesz lubaczewski <depesz@depesz.com> writes:
>> it is selecting 20 rows out of 30 million. why is it:
>> 1. not using index only scan
>> 2. not using even normal index scan?
>
> It thinks the bitmap scan is cheaper.  Whether that's true or not is not
> very clear, but nobody is claiming that the costing of index-only scans
> is accurate yet.
>

I did a few tests and bitmap scan is faster. Maybe there is a some
issue. In very simple test (and very syntetic test)

create table omega(a int);
insert into omega select (random()*10000)::int from generate_series(1,400000);

select count(*) from omega where a = 100;

and index scan is faster than index only scan. There is lot of
duplicates. When I used a bigger range, a speed of bitmap index, index
only scan and index scan is similar - but index scan was faster
everywhere.

Regards

Pavel Stehule


>                        regards, tom lane
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

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

Предыдущее
От: pasman pasmański
Дата:
Сообщение: Re: [9.2devel] why it doesn't do index scan only?
Следующее
От: Thom Brown
Дата:
Сообщение: Re: [9.2devel] why it doesn't do index scan only?