Indexes are a common way to enhance database performance. An index allows the database server to find and retrieve specific rows much faster than it could do without an index.
PostgreSQL provides several index types:
CREATE INDEX test1_id_index ON test1 (id);
An index can be defined on more than one column of a table.
CREATE INDEX test2_mm_idx ON test2 (major, minor);
CREATE UNIQUE INDEX title_idx ON films (title);
A partial index is an index built over a subset of a table.
CREATE INDEX orders_unbilled_index ON orders (order_nr)
WHERE billed IS NOT true;