Clarification on Expression indexes

From: Koen De Groote <kdg(dot)dev(at)gmail(dot)com>
To: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Clarification on Expression indexes
Date: 2020-06-16 21:53:13
Message-ID: CAGbX52GGzhBk+QtR8MeC_-rA=1ots=oCCAxQPouO84rQjDhfUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings all.

The following page:
https://www.postgresql.org/docs/11/indexes-expressional.html

States the following:

Index expressions are relatively expensive to maintain, because the derived
> expression(s) must be computed for each row upon insertion and whenever it
> is updated
>

I'd like to get an idea on "relatively expensive". For instance, compared
to a partial index, which is split on one or more boolean values. As
opposed to making a function for this that serves the same identical
calculation.

Let's say that over the lifetime of a row, it rarely gets updated more than
2000 times, and the majority of this is right after creation?

Is this a concern?

Regards,
Koen De Groote

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-06-16 22:20:59 Re: Clarification on Expression indexes
Previous Message Eugene Pazhitnov 2020-06-16 21:30:13 Re: pg_repack: WARNING: relation must have a primary key or not-null unique keys