Re: I don't understand this
| От | Jan Wieck |
|---|---|
| Тема | Re: I don't understand this |
| Дата | |
| Msg-id | 200204292059.g3TKxF816559@saturn.janwieck.net обсуждение исходный текст |
| Ответ на | I don't understand this (Uros Gruber <uros@sir-mag.com>) |
| Список | pgsql-general |
Uros Gruber wrote:
> Hi!
>
> i create some table with primary key and one index key
> Then i insert data and try some explain on my select.
>
> it tells me that index was used.
>
>
> then i do some other queries and vacuum and when i try again
> SAME explain it prints that it was used Seq Scan
>
> It this normal or what. Or is some kind of a bug.
Yes, this is normal.
The statistics defaults for an un-vacuumed table usually
cause the optimizer to use an index scan. When you analyze
the table later, the statistics reflect the real status and
for very small tables, a sequential scan is normally better
than an index scan.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
В списке pgsql-general по дате отправления: