Re: [GENERAL] Simple Query not using Primary Key Index
| От | Vitaly Burovoy |
|---|---|
| Тема | Re: [GENERAL] Simple Query not using Primary Key Index |
| Дата | |
| Msg-id | CAKOSWNkhGqm6wWuAcrjjJYL0eKNQ6odFREXjgnki9bwA0Hb-6Q@mail.gmail.com обсуждение исходный текст |
| Ответ на | [GENERAL] Simple Query not using Primary Key Index ("Podrigal, Aron" <aronp@guaranteedplus.com>) |
| Ответы |
Re: [GENERAL] Simple Query not using Primary Key Index
|
| Список | pgsql-general |
On 2/6/17, Podrigal, Aron <aronp@guaranteedplus.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? Postgres uses specified access methods according to table's statistics. If you have a small table, it is likely that Postgres uses SeqScan because it is similar or cheaper than IndexScan. That's why it can ignore existing indexes. -- Best regards, Vitaly Burovoy
В списке pgsql-general по дате отправления: