Mladen Gogala <mladen.gogala@vmsinfo.com> wrote:
> Yes, Oracle can be forced into doing a sequential scan and it is
> actually faster than an index scan:
And PostgreSQL can be coerced to use an indexed scan. Its plans are
cost-based, with user configurable cost factors; so if you tell it
that seq_page_cost and random_page_cost are both equal to some
really low value (like 0.001), you'll get an index scan. Part of
the process of tuning PostgreSQL is to discover the relative
*actual* costs on *your environment* (which is largely dependent on
the degree of caching of the active portion of your database). When
you get your costing factors to approximate reality, the optimizer
will do a pretty good job of picking the fastest plan.
-Kevin