Re: [GENERAL] Matching indexe for timestamp

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [GENERAL] Matching indexe for timestamp
Дата
Msg-id CAKFQuwZ5Nx5OANS1nhx-mEsvQa4nbLYJ8c3vQg_AgO7C7qxCbQ@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Matching indexe for timestamp  (Job <Job@colliniconsulting.it>)
Список pgsql-general
On Mon, Jan 9, 2017 at 2:58 PM, Job <Job@colliniconsulting.it> wrote:

But in the query planner, at that point, Postgresql 9.6.1 seems not to use any index (single on dalle / alle field and combindex index on dalle+alle) but it use seqscan:
 
Seq Scan on gruorari_tmp  (cost=0.00..5.90 rows=290 width=68) (actual time=0.014..0.062 rows=290 loops=1)
                                 ->  Hash  (cost=164.06..164.06 rows=1 width=29) (actual time=0.770..0.770 rows=1 loops=1)


​Given a query with expected "rows=290" I am not surprised that it would simply scan the entire relation.  Especially since you have four columns in your where clause and so any one index would be insufficient.

You sound as if you believe that any query that doesn't use an index is flawed.  That is not the case.

David J.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: R: [GENERAL] Matching indexe for timestamp
Следующее
От: Vitaly Burovoy
Дата:
Сообщение: Re: [GENERAL] Matching indexe for timestamp