Re: Index of expression over table row or column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Lau <stevelauc(at)outlook(dot)com>
Cc: "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Index of expression over table row or column
Date: 2024-10-16 03:23:08
Message-ID: 4169601.1729048988@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Steve Lau <stevelauc(at)outlook(dot)com> writes:
> I am reading this documentation[1], and it has a sentence that I don’t quite understand: "The index columns (key values) can be either simple columns of the underlying table or expressions over the table rows.”, I am thinking that for the index of expressions, aren’t those expressions over table column? e.g., “CREATE INDEX idx_lower_last_name ON users(LOWER(last_name))”, “last_name" is a column rather than a row.

Consider

CREATE INDEX idx_lower_name ON users(LOWER(last_name || ' ' || first_name));

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Steve Lau 2024-10-16 04:00:17 Re: Index of expression over table row or column
Previous Message David G. Johnston 2024-10-16 03:21:15 Re: Index of expression over table row or column