Re: Bugs/slowness inserting and indexing cubes

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jay Levitt <jay(dot)levitt(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bugs/slowness inserting and indexing cubes
Date: 2012-02-08 19:53:36
Message-ID: CA+TgmoZpuybBKzaknUww46OkMn=OoVeyNuKti7rd8kkwTRqMig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 8, 2012 at 2:38 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Wed, Feb 8, 2012 at 2:15 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> ISTM there are two ways we could fix this:
>>>
>>> 1. Introduce a duplicative test at the start of gistbuild().
>>>
>>> 2. Rearrange the order of operations in index_build() so that the init
>>> fork is made first.
>>>
>>> Both of these are kinda ugly, but #2 puts the ugliness into someplace
>>> that shouldn't have to know about it, and furthermore someplace that's
>>> unlikely to get reverted if/when gist is fixed to not have this problem.
>>> So I think I favor #1.  Other opinions anyone?
>
>> I don't think I understand your object to #2.  It appears to be a
>> trivial rearrangement?
>
> Yeah, but then we are wiring into index_build the idea that ambuildempty
> is more important, or more likely to throw an error, or something, than
> ambuild is. It seems weird.  And fragile, since somebody could decide
> to re-order those two steps again for reasons unrelated to gist.

I guess. I think the compelling reason to do ambuildempty first is
that it's fast. So might as well. I think you'e just going to end up
hard-wiring the assumption that ambuild happens before ambuildempty,
which doesn't seem any better than the other way around, but I don't
care enough to argue about if you feel strongly about it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2012-02-08 20:10:38 Re: Bugs/slowness inserting and indexing cubes
Previous Message Peter Geoghegan 2012-02-08 19:50:18 Re: Progress on fast path sorting, btree index creation time