Re: [GENERAL] Index scan vs indexonly scan method

2014-10-22 Thread Jeff Janes
On Wed, Oct 22, 2014 at 8:18 AM, Enrico Pirozzi wrote: > Hi, > I was working on this simple query > > select field1 from table A > where A.field2 <= some_value > order by 1 desc limit some_value > > and I saw that: > > 1) the planner on this query uses an index only scan method: > > select field1

Re: [GENERAL] Index scan vs indexonly scan method

2014-10-22 Thread Enrico Pirozzi
The background on index-only scans: https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.2#Index-only_scans In either case(index, index-only) the index has to be scanned. The difference is where the data is pulled from. In the index-only scan the query still needs to consult the

Re: [GENERAL] Index scan vs indexonly scan method

2014-10-22 Thread Adrian Klaver
On 10/22/2014 08:18 AM, Enrico Pirozzi wrote: Hi, I was working on this simple query select field1 from table A where A.field2 <= some_value order by 1 desc limit some_value and I saw that: 1) the planner on this query uses an index only scan method: select field1 from table A where A.field2