Re: Proposal: Global Index

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: 曾文旌 <wenjing(dot)zwj(at)alibaba-inc(dot)com>
Cc: Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Geoghegan <pg(at)bowt(dot)ie>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Amit Langote <amitlangote09(at)gmail(dot)com>, Hamid Akhtar <hamid(dot)akhtar(at)gmail(dot)com>, "heikki(dot)linnakangas" <heikki(dot)linnakangas(at)iki(dot)fi>, "Nasby, Jim" <nasbyj(at)amazon(dot)com>
Subject: Re: Proposal: Global Index
Date: 2021-01-08 15:50:40
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jan 8, 2021 at 11:26:48AM +0800, 曾文旌 wrote:
> > On Thu, Jan 7, 2021 at 05:44:01PM +0800, 曾文旌 wrote:
> >> I've been following this topic for a long time. It's been a year since the last response.
> >> It was clear that our customers wanted this feature as well, and a large number of them mentioned it.
> >>
> >> So, I wish the whole feature to mature as soon as possible.
> >> I summarized the scheme mentioned in the email and completed the POC patch(base on PG_13).
> >
> > I think you need to address the items mentioned in this blog, and the
> > email link it mentions:
> >
> >
> Thank you for your reply.
> I read your blog and it helped me a lot.
> The blog mentions a specific problem: "A large global index might also reintroduce problems that prompted the creation of partitioning in the first place. "
> I don't quite understand, could you give some specific information?

Well, if you created partitions, you probably did so because:

1. heap files are smaller, allowing for more targeted sequential scans
2. smaller indexes
3. the ability to easily drop tables/indexes that are too old

If you have global indexes, #1 is the same, but #2 is not longer true,
and for #3, you can drop the heap but the index entries still exist in
the global index and must be removed.

So, if you created partitions for one of the three reasons, once you
have global indexes, some of those advantage of partitioning are no
longer true. I am sure there are some workloads where the advantages of
partitioning, minus the advantages lost when using global indexes, are
useful, but are there enough of them to make the feature useful? I
don't know.

> In addition you mentioned: "It is still unclear if these use-cases justify the architectural changes needed to enable global indexes."
> Please also describe the problems you see, I will confirm each specific issue one by one.

Well, the email thread I linked to has a lot of them, but the
fundamental issue is that you have to break the logic that a single
index serves a single heap file. Considering what I said above, is
there enough usefulness to warrant such an architectural change?

Bruce Momjian <bruce(at)momjian(dot)us>

The usefulness of a cup is in its emptiness, Bruce Lee

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-01-08 15:54:47 Re: Improper use about DatumGetInt32
Previous Message David Steele 2021-01-08 14:46:58 Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)