index-only-scan when there is an index on all columns

2018-02-27 Thread Hadi Moshayedi
With the following definition: create table t1 (a int, b int, c int); create index on t1 (a,b,c); I get the following plan for the following query: postgres=# explain select sum(c) from t1 where a > 0; QUERY PLAN --

index-only-scan when there is an index on all columns

2018-02-27 Thread Hadi Moshayedi
With the following definition: create table t1 (a int, b int, c int); create index on t1 (a,b,c); I get the following plan for the following query: postgres=# explain select sum(c) from t1 where a > 0; QUERY PLAN ---