On Mon, Sep 13, 2021 at 05:27:00AM +0000, PG Bug reporting form wrote:
> I have created the composite primary key which is created successfully but i
> am not getting the index against the primary key.
That's rather impossible. Please show create table statement, and output
of `\d table_name` after creation.
> When i created a select query and includes the primary key column it is
> going with full table scan. Even i am creating an index on the columns it is
> also going with full table scan.
Index will be used only when it makes sense.
If you'd do: select * from table; - that is select all rows - there is
no point in using index, as it will be slower than getting seq scan.
Plus - your table can be too small to effectively use index.
Consider reading:
https://www.depesz.com/2010/09/09/why-is-my-index-not-being-used/
Best regards,
depesz