Re: Inadequate executor locking of indexes

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Inadequate executor locking of indexes
Дата
Msg-id CAKJS1f-g6fHxGGyFmjw=H+D7-esC6ECjDvvVYHK1oQHcsg2-tQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Inadequate executor locking of indexes  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Inadequate executor locking of indexes  (David Rowley <david.rowley@2ndquadrant.com>)
Список pgsql-hackers
On Tue, 12 Feb 2019 at 09:58, Julien Rouhaud <rjuju123@gmail.com> wrote:
>
> On Mon, Feb 11, 2019 at 5:32 AM David Rowley
> <david.rowley@2ndquadrant.com> wrote:
> > 1. Adding a new field to RangeTblEntry to indicate the operation type
> > that's being performed on the relation; or
> > 2. Adding a Bitmapset field to PlannerGlobal that sets the rtable
> > indexes of RangeTblEntry items that belong to DELETEs and ignore these
> > when setting resultRelids in finalize_lockmodes().
> >
> > For #2, the only place I can see to do this is
> > add_rtes_to_flat_rtable(), which would require either passing the
> > PlannerInfo into the function, or at least its parse's commandType.
> >
> > I don't really like either, but don't have any other ideas at the moment.
>
> But we would still need the same lock level upgrade logic on indexes
> for cases like CTE with a mix of INSERT, UPDATE and DELETE on the same
> relation I think.  #1 seems like a better solution to me.

I think I'd rather find some way to do it that didn't denormalise the
parse nodes like that.  It seems very strange to have a CmdType in the
Query struct, and then another set of them in RangeTblEntry. Besides
bloating the size of the RangeTblEntry struct a bit, it also could
lead to inconsistency bugs where the two CmdTypes differ, for some
reason.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Delay locking partitions during INSERT and UPDATE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Delay locking partitions during INSERT and UPDATE