Re: Why is indexonlyscan so darned slow?

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: Why is indexonlyscan so darned slow?
Дата
Msg-id CAMkU=1woatEkfHguEiLF3zFYhrf2OKUGpXLV_07uQEwShoL8Jg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Why is indexonlyscan so darned slow?  (Joshua Berkus <josh@agliodbs.com>)
Ответы Re: Why is indexonlyscan so darned slow?  (Joshua Berkus <josh@agliodbs.com>)
Список pgsql-hackers
On Thu, May 17, 2012 at 5:22 AM, Joshua Berkus <josh@agliodbs.com> wrote:
> Ants,
>
> Well, that's somewhat better, but again hardly the gain in performance I'd expect to see ... especially since this is
idealcircumstances for index-only scan. 
>
> bench2=# select count(*) from pgbench_accounts;
>  count
> ----------
>  20000000
> (1 row)
>
> Time: 3827.508 ms
>
> bench2=# set enable_indexonlyscan=off;
> SET
> Time: 0.241 ms
> bench2=# select count(*) from pgbench_accounts;
>  count
> ----------
>  20000000
> (1 row)
>
> Time: 16012.444 ms
>
> For some reason counting tuples in an index takes 5X as long (per tuple) as counting them in a table.  Why?
>

It looks like the IOS is taking 4x less time, not more time.

Anyway, the IOS follows the index logical structure, not the physical
structure, so if the index is not in RAM it will really be hurt by the
lack of sequential reads.

Cheers,

Jeff


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Pre-alloc ListCell's optimization
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Strange issues with 9.2 pg_basebackup & replication