"Thomas T. Thai" <tom@minnesota.com> writes:
> > > i can't seem to get index scan to work on table phone_cat_address. here
> > > are my schemas:
> >
> > Standard question: have you run VACUUM ANALYZE?
>
> yes :) before each test.
Excellent. ;)
>
> > Also, the estimate of rows returned from the phone_cat_address scan is
> > pretty large--how large is the table itself? Sequential scan is
> > actually faster if you're going to end up returning most of the rows
> > in the table...
>
> yellowpages=# select count(*) from phone_cat_address;
> count
> --------
> 336702
> (1 row)
>
> type typical results should be a tiny fraction of that number.
Well, EXPLAIN is indicating (unless I misread it) that the estimate of
rows returned is 336702, so it's not surprising that it opts for a
sequential scan. Is this under 7.1 or 7.2? The latter keeps much
better statistics about table populations...
-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863