On Fri, Nov 16, 2012 at 2:00 PM, Chris Tyler <chris(a)tylers.info> wrote:
(Investigations into PostgreSQL being insanely brain-dead continue.
Example: query strategy for "SELECT COUNT(*) FROM FOO;" involves a
"Sequential scan over 1496312 records." Srsly?)
Just curious... have you VACUUM'd the database? Are you running
AUTO-VACUUM? Have you run EXPLAIN ANALYZE SELECT COUNT(*) FROM FOO?
In general, once you learn a few tricks like this, it's typically much
easier to figure out why PostgreSQL is choosing a particular query
plan than it is with other databases.
--
Jared Smith