Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [tarantool-patches] Re: [PATCH 2/3] vinyl: move unique check optimization setup to the space level
Date: Thu, 25 Jul 2019 11:46:42 +0300	[thread overview]
Message-ID: <20190725084642.GE24631@esperanza> (raw)
In-Reply-To: <20190724223141.GB13150@atlas>

On Thu, Jul 25, 2019 at 01:31:41AM +0300, Konstantin Osipov wrote:
> > +/** A trivial wrapper around space_build_index(). */
> > +static void
> > +alter_space_build_index(struct space *src_space, struct space *new_space,
> > +			struct index *new_index)
> > +{
> > +	bool check_unique = space_needs_check_unique(new_space,
> > +						     new_index->def->iid);
> 
> check_unique is not proper English, please use
> check_unique_constraint or check_unique_ck.

Yeah, sure, will rename to check_unique_constraint.

> 
> > +	space_build_index_xc(src_space, new_index, new_space->format,
> > +			     check_unique);
> 
> Why can't you move testing check_unique property inside space_build_index
> or even the engine specific implementation of space_build_index?

Then I would need to pass the old space to the function, which I'd like
to avoid, because this would make the function proto less obvious.

> 
> > +	space->unique_index_bitmap = calloc(bitmap_size(index_id_max + 1), 1);
> 
> Let's use check_unique_constraint_map

Okay.

> > +/**
> > + * Return true if the unique constraint must be checked for
> > + * the index with the given id before inserting a tuple into
> > + * the space.
> > + */
> > +static inline bool
> > +space_needs_check_unique(struct space *space, uint32_t index_id)
> 
> space_needs_unique_constraint_check

Okay.

  reply	other threads:[~2019-07-25  8:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 15:49 [PATCH 0/3] Fix crash on rollback of mixed DML/DDL transaction Vladimir Davydov
2019-07-23 15:49 ` [PATCH 1/3] vinyl: use update_def index method to update vy_lsm on ddl Vladimir Davydov
2019-07-24 22:25   ` [tarantool-patches] " Konstantin Osipov
2019-07-25  8:38     ` Vladimir Davydov
2019-07-25 12:11   ` Vladimir Davydov
2019-07-23 15:49 ` [PATCH 2/3] vinyl: move unique check optimization setup to the space level Vladimir Davydov
2019-07-24 22:31   ` [tarantool-patches] " Konstantin Osipov
2019-07-25  8:46     ` Vladimir Davydov [this message]
2019-07-25 12:11   ` Vladimir Davydov
2019-07-23 15:49 ` [PATCH 3/3] alter: fix rollback in case DDL and DML are used in the same transaction Vladimir Davydov
2019-07-24 22:32   ` [tarantool-patches] " Konstantin Osipov
2019-07-25  8:51     ` Vladimir Davydov
2019-07-30 10:56       ` Vladimir Davydov
2019-07-30 12:14         ` Konstantin Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190725084642.GE24631@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] Re: [PATCH 2/3] vinyl: move unique check optimization setup to the space level' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox