Index only select count(*)

Поиск
Список
Период
Сортировка
От Toni Helenius
Тема Index only select count(*)
Дата
Msg-id E6A9CAA76548CB4EB02D2E3B174DD3B1EF9E189425@ink.sad.syncrontech.com
обсуждение исходный текст
Ответы Re: Index only select count(*)  (Alban Hertroys <haramrae@gmail.com>)
Список pgsql-general

Hello,

 

I have a table with 961 columns. 1 of the columns is included in a primary key. The table has 52 760 rows. The table size is 137 MB and indexes size is 1176 kB (just the primary key). When I try:

SELECT count(*)

on it, it uses Seq Scan instead of Index scan. The query takes ~3 seconds. I have almost 500 similar tables. No index scans, why?

 

I’m using PostgreSQL 9.2.4 server. And I’ve read https://wiki.postgresql.org/wiki/Index-only_scans , apparently without understanding it. This is quite a performance issue to us. I’ve manually vacuumed and recreated indexes and all. No help. The output of analyze:

"Aggregate  (cost=18240.50..18240.51 rows=1 width=0)"

"  ->  Seq Scan on min1_009  (cost=0.00..18108.60 rows=52760 width=0)"

 

--

Toni Helenius

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: C-language stored function and float4 type
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: Index only select count(*)