Scott Marlowe <scott.marlowe@ihs.com> writes:
> You can change the setting of enable_seqscan and enable_indexscan to force
> your planner to ignore one or the other, and time the output. It's pretty
> easy to do a quick timing test like so:
> time psql -c 'set enable_seqscan=off;select * from tellers' >/dev/null
It's difficult to get accurate measurements that way. I'd recommend
using 7.2's EXPLAIN ANALYZE instead, and looking at the total runtime
it displays.
Even with EXPLAIN ANALYZE, I'd recommend repeating the command a couple
of times to see how much the runtime varies before you trust the results
very far. Disk caching can cause the second execution to take far less
time than the first, even with the identical plan.
regards, tom lane