Re: Matching indexe for timestamp

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Job <Job(at)colliniconsulting(dot)it>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Matching indexe for timestamp
Date: 2017-01-09 23:53:03
Message-ID: CAKFQuwZ5Nx5OANS1nhx-mEsvQa4nbLYJ8c3vQg_AgO7C7qxCbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 9, 2017 at 2:58 PM, Job <Job(at)colliniconsulting(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vitaly Burovoy 2017-01-10 00:09:00 Re: Matching indexe for timestamp
Previous Message Adrian Klaver 2017-01-09 23:50:57 Re: R: Matching indexe for timestamp