Re: Simple Query not using Primary Key Index

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: "Podrigal, Aron" <aronp(at)guaranteedplus(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Simple Query not using Primary Key Index
Date: 2017-02-06 23:23:37
Message-ID: 0BA27597-9745-4482-889F-50EC5E300073@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On 7 Feb 2017, at 0:16, Podrigal, Aron <aronp(at)guaranteedplus(dot)com> wrote:
>
> Hi,
>
> I noticed when I do a simple SELECT id FROM mytable WHERE id = 'cb81d070-4213-465f-b32e-b8db43b83a25'::UUID Postgres does not use the primary key index and opts for a Seq Scan.
>
> I of course did VACUUM ANALYZE and I have reset statistics But no sign. Is there any particular thing I should be looking at?

An EXPLAIN ANALYZE would be a good start.

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aron Podrigal 2017-02-06 23:29:16 Re: Simple Query not using Primary Key Index
Previous Message Podrigal, Aron 2017-02-06 23:16:19 Simple Query not using Primary Key Index