"Albe Laurenz" <laurenz.albe@wien.gv.at> writes:
> Andreas wrote:
>> Both select where shown as 'Index Scan'. But the second select is not
> a real index scan,
> A full scan of the index is also an index scan.
Yes. In particular it won't visit the heap for rows that don't satisfy
the index condition. So as long as the index is a good deal smaller
than the heap, this sort of plan is entirely sensible.
> I think that your example is pathological, and the only way I could
> reproduce it is by setting enable_seqscan=off.
I'm thinking he's got random_page_cost = 1.
regards, tom lane