[PATCH v2 2/3] sql: remove space_by_id() from analyze.c

Vladimir Davydov vdavydov.dev at gmail.com
Thu Apr 4 20:41:43 MSK 2019


On Thu, Apr 04, 2019 at 07:03:49PM +0300, Vladimir Davydov wrote:
> On Wed, Apr 03, 2019 at 07:58:34PM +0300, imeevma at tarantool.org wrote:
> > diff --git a/src/box/sql/build.c b/src/box/sql/build.c
> > index c475b34..a06ba3e 100644
> > --- a/src/box/sql/build.c
> > +++ b/src/box/sql/build.c
> > @@ -1384,23 +1384,6 @@ vdbe_emit_stat_space_clear(struct Parse *parse, const char *stat_table_name,
> >  }
> >  
> >  /**
> > - * Remove entries from the _sql_stat1 and _sql_stat4
> > - * system spaces after a DROP INDEX or DROP TABLE command.
> > - *
> > - * @param parse      The parsing context.
> > - * @param table_name The table to be dropped or
> > - *                   the table that contains index to be dropped.
> > - * @param idx_name   Index to be dropped.
> > - */
> > -static void
> > -sql_clear_stat_spaces(struct Parse *parse, const char *table_name,
> > -		      const char *idx_name)
> > -{
> > -	vdbe_emit_stat_space_clear(parse, "_sql_stat4", idx_name, table_name);
> > -	vdbe_emit_stat_space_clear(parse, "_sql_stat1", idx_name, table_name);
> > -}
> 
> I would leave this function and instead comment its body so that we
> don't forget to resurrect this code when we reimplement stat tables.
> Other than that, looks good to me.

On the second thought, it doesn't make much sense to leave this function
as we'll have to rewrite it anyway when we reintroduce stat tables. And
it's pretty obvious that we should clear stat entries on space/index
drop so there's no need in this placeholder.

That said, the patch is okay to commit as is IMO.



More information about the Tarantool-patches mailing list