Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-28 Thread Shayon Mukherjee
On Thu, Apr 24, 2025 at 12:45 AM jian he wrote: > hi. > The following is a review of version 17. > > ATExecSetIndexVisibility > if (indexForm->indisvisible != visible) > { > indexForm->indisvisible = visible; > CatalogTupleUpdate(pg_index, &indexTuple->t_self, indexTuple);

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-24 Thread jian he
hi, two more minor issues. src/bin/pg_dump/pg_dump.c if (fout->remoteVersion >= 18) need change to if (fout->remoteVersion >= 19) +-- Test index visibility with partitioned tables +CREATE TABLE part_tbl(id int, data text) PARTITION BY RANGE(id); +CREATE TABLE part1 PARTITION OF part_tbl

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-23 Thread jian he
hi. The following is a review of version 17. ATExecSetIndexVisibility if (indexForm->indisvisible != visible) { indexForm->indisvisible = visible; CatalogTupleUpdate(pg_index, &indexTuple->t_self, indexTuple); CacheInvalidateRelcache(heapRel); InvokeObjectPo

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-10 Thread Shayon Mukherjee
On Mon, Apr 7, 2025 at 5:39 PM Sami Imseih wrote: > > Attached v16 with feedback and rebased. > > Thanks, and I realized the original tab-complete I proposed > was not entirely correct. I fixed it and also shortened the > commit message. I was wondering about if the check needed to be more enco

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-07 Thread Sami Imseih
> Attached v16 with feedback and rebased. Thanks, and I realized the original tab-complete I proposed was not entirely correct. I fixed it and also shortened the commit message. -- Sami Imseih Amazon Web Services (AWS) v17-0001-Introduce-the-ability-to-set-index-visibility-us.patch Description

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-07 Thread Shayon Mukherjee
On Mon, Apr 7, 2025 at 4:01 PM Sami Imseih wrote: > Thanks for the update! > > The changes in v15 look good to me. The patch does need to be rebased, > and I also think you should add a tab-complete for CREATE INDEX > > > simseih@bcd07415af92 postgresql % git diff > diff --git a/src/bin/psql/tab-

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-07 Thread Sami Imseih
Thanks for the update! The changes in v15 look good to me. The patch does need to be rebased, and I also think you should add a tab-complete for CREATE INDEX simseih@bcd07415af92 postgresql % git diff diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c index 8e2eb50205e.

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-05 Thread Shayon Mukherjee
On Wed, Apr 2, 2025 at 10:53 PM Sami Imseih wrote: > > That seems like a very good location for this advice. But the current > > set of bullet points are all directed towards "... a general procedure > > for determining which indexes to create". I propose that a new paragrph, > > not a bullet poi

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-05 Thread Gurjeet Singh
On Wed Apr 2, 2025 at 6:58 PM PDT, Sami Imseih wrote: >> > + indexes. If performance degrades after making an index invisible, it can >> > be easily >> > + be made visible using VISIBLE. Before making an index >> > invisible, it's recommended >> > + to check >> > pg_stat_user_indexes.idx_scan >>

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-02 Thread Sami Imseih
> That seems like a very good location for this advice. But the current > set of bullet points are all directed towards "... a general procedure > for determining which indexes to create". I propose that a new paragrph, > not a bullet point, be added towards the end of that section which > addresse

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-02 Thread Sami Imseih
> > + indexes. If performance degrades after making an index invisible, it can > > be easily > > + be made visible using VISIBLE. Before making an index > > invisible, it's recommended > > + to check > > pg_stat_user_indexes.idx_scan > > + to identify potentially unused indexes. > > I feel ALTER

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-01 Thread Gurjeet Singh
On Sun, Sep 22, 2024 at 3:45 PM David Rowley wrote: > I think the documents should also mention that disabling an index is a > useful way to verify an index is not being used before dropping it as > the index can be enabled again at the first sign that performance has > been effected. (It might a

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2024-09-22 Thread David Rowley
On Mon, 23 Sept 2024 at 05:43, Shayon Mukherjee wrote: > - Modified get_index_paths() and build_index_paths() to exclude disabled > indexes from consideration during query planning. There are quite a large number of other places you also need to modify. Here are 2 places where the index should

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2024-09-22 Thread Shayon Mukherjee
Hello, I realized there were some white spaces in the diff and a compiler warning error from CI, so I have fixed those and the updated patch with v2 is now attached. Shayon On Sun, Sep 22, 2024 at 1:42 PM Shayon Mukherjee wrote: > Hello, > > Thank you for all the feedback and insights. Work wa

[PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2024-09-22 Thread Shayon Mukherjee
Hello, Thank you for all the feedback and insights. Work was busy, so I didn't get to follow up earlier. This patch introduces the ability to enable or disable indexes using ALTER INDEX and CREATE INDEX commands. Original motivation for the problem and proposal for a patch can be found here[0]