Postgresql – Storage efficiency of Postgres index column

performancepostgresqlpostgresql-performance

In my PostgreSQL database, I have this table:

    Table "public.data"
  Column   |  Type  | Modifiers 
-----------+--------+-----------
  group_id | bigint | 
      item | text   | 
     price | real   | 
Indexes:
    "group_id_index" btree (group_id)

item's are organized into groups, and the group_id column will have individual values appearing many times in the table. Queries to this table have the form:

SELECT item, price FROM data WHERE group_id = 1234;

group_id_index speeds up these queries (as is its purpose).

My question is, does the presence of the index make Postgres realize it does not have to store the group_id column behind-the-scenes? If only one copy (for the index) of each value of group_id is stored, that would save a lot of space.

This is, if it matters, PostgreSQL version 9.4.1

Best Answer

My question is, does the presence of the index make Postgres realize it does not have to store the group_id column behind-the-scenes?

No. PostgreSQL uses heaps, not index-organised tables.