Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
Cc: Shayon Mukherjee <shayonj(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)
Date: 2024-12-31 03:52:12
Message-ID: CAA5RZ0sWpQZxjO9NEchwPeDbtw2HFWF-v8MscBDcm00FB6N_3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Should this not behave like if you drop (or create) an index
> during a prepared statement? I have not yet looked closely at
> this code to see what could be done.
>
> Regards,

I looked at this a bit more and ATExecEnableDisableIndex
needs some tweaks.

What should be getting invalidated in the heap relation
that the index is on and not the index relation as it is in
the current patch.

You can retrieve the heap relation oid
IndexGetRelation(indexOid, false) and the
CacheInvalidateRelcache should be on the heap relation.

The planner needs to only care about the heap relation
invalidation to re-plan across multiple executions of
a prepared statement.

There should be a test for this scenario as well.

Regards,

Sami

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message wenhui qiu 2024-12-31 03:55:07 add vacuum starttime columns
Previous Message Roberto C. Sánchez 2024-12-31 03:27:28 Re: Backport of CVE-2024-10978 fix to older pgsql versions (11, 9.6, and 9.4)