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 #