Postgresql – Postgres not using index when filtered/indexed value does not exist
In Postgres 16.2 I've a table Product with extra index: CREATE TABLE Product (id SERIAL , name: text, companyId: number, PRIMARY KEY (id)); CREATE INDEX product_company_id ON Product (companyId); The table has about 12M rows. When I search for a…