Re: explain and index scan - Mailing list pgsql-general

From Tom Lane
Subject Re: explain and index scan
Date
Msg-id 14493.1330359985@sss.pgh.pa.us
Whole thread Raw
In response to Re: explain and index scan  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
List pgsql-general
"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

pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Four issues why "old elephants" lack performance: Explanation sought Four issues why "old elephants" lack performance: Explanation sought
Next
From: "James B. Byrne"
Date:
Subject: Having a problem with RoR-3.1.1 and Pg-9.1