Rod Taylor <rbt@rbt.ca> writes:
>> What can I do to fix this -- is there something I am missing about
>> setting statistics or some configuration variable I can change? Any
>> insights would be greatly appreciated. Thank you,
> You might try adjusting the random_page_cost down to something more
> appropriate for your hardware and situation.
Also, is the table physically ordered by dsid? If so, is that condition
likely to persist? You may be looking at a test-condition artifact
here --- a poor estimate for an ordered table may not mean much when
you get to realistic database states.
I assume you've done an ANALYZE of course --- what does the pg_stats row
for column dsid contain?
regards, tom lane