pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steve Lau <stevelauc@outlook.com>
Cc: pgsql-docs@postgresql.org <pgsql-docs@postgresql.org>
Subject: Re: Index of expression over table row or column
Date: Tue, 15 Oct 2024 23:23:08 -0400
Message-ID: <4169601.1729048988@sss.pgh.pa.us> (raw)
In-Reply-To: <964FED20-AC2E-47C5-86FB-95C356A68B81@outlook.com>
References: <964FED20-AC2E-47C5-86FB-95C356A68B81@outlook.com>

Steve Lau <stevelauc@outlook.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





view thread (6+ messages)  latest in thread

Message-ID: <4169601.1729048988@sss.pgh.pa.us>
Permalink:  ../4169601.1729048988@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4169601.1729048988@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, stevelauc@outlook.com
  Subject: Re: Index of expression over table row or column
  In-Reply-To: <4169601.1729048988@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox