Re: Indirect indexes

From: "Sven R(dot) Kunze" <srkunze(at)mail(dot)de>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Indirect indexes
Date: 2016-10-21 19:48:33
Message-ID: a3ddce35-8c3e-2021-ab93-4b137cb4bee0@mail.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016-10-18 20:04:32, Claudio Freire wrote:

> You don't need that limitation (and vacuum will be simpler) if you add
the PK as another key, akin to:
>
> CREATE INDIRECT INDEX idx ON tab (a, b, c);
>
> turns into
>
> CREATE INDEX idx ON tab (a, b, c, pk);

I know I am late to this point but I wanted to present my mere user's
point of view.

First I liked it, as does not introduce yet another syntax to learn.
However, after following the discussion, I see that indirect indexes
have their disadvantages/slowdowns as well. If adding "pk" to the end of
the column list just converts the index to an indirect index, I am
unable to use a direct index which might be better in certain cases.

So, from a "dumb" user's point of view, I wonder if PostgreSQL can make
the right decision of direct/indirect reliably (which would be great).
And if not, what would be the alternatives? Introducing CREATE DIRECT INDEX?

Cheers,
Sven

PS: I mot saying I would be affected by this but IIRC we have (..., pk)
indexes in production which then would be converted to indirect ones.
But I cannot tell whether indirect indexes would do good or harm there.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-10-21 20:17:11 Re: FSM corruption leading to errors
Previous Message Alvaro Herrera 2016-10-21 19:29:01 Re: Renaming of pg_xlog and pg_clog