> As you know version 11 gives us the possibility to include aditional columns
> to an index.
> So, if I recreate all my primary key indexes to contain a description
> column, like ...
> CREATE UNIQUE INDEX CONCURRENTLY Products_pk ON Products(Product_ID)
> ALTER TABLE Products ADD CONSTRAINT Products_pk PRIMARY KEY(Product_ID)
> USING INDEX Products_pk
> Then, when I do
> select Item_ID, Product_ID, Name from Items inner join Products
> I thought It would do a index scan only for Products table, but it does not,
> why ?
Because an index is overhead and depending on the situation the planner
may determine it is better not to use it.
Post the results of:
EXPLAIN ANALYZE select Item_ID, Product_ID, Name from Items inner join
That will help understand what the planner is doing.