Thread: Optimizer Question

Optimizer Question

From
Dimitri
Date:
Hi All!

I've tried some developements with PG and was surprised
by optimizer... So:

1. Why in query: "select distinct Attr from Table;"
optimizer never use Attr's index and always pass by Seq Scan?

2. Why in general any queries like:
    select Attr from Table where --any conditions with Attr--;
optimizer choose Seq Scan and not Attr's index, when using of
Attr's index significally increases performance...

Thanks for any help.
(dim)

--
=====================================================
 Dimitri KRAVTCHUK  (dim)           Sun Microsystems
 Benchmark Engineer                 France
 dimitri@France.Sun.COM
=====================================================