From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D875E2F522 for ; Wed, 29 May 2019 10:02:19 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kXa85XrNbwUY for ; Wed, 29 May 2019 10:02:19 -0400 (EDT) Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 960242F50E for ; Wed, 29 May 2019 10:02:19 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 6/8] Removes the following unused macros: SQL_EXPLAIN_ESTIMATED_ROWS SQL_ENABLE_COLUMN_USED_MASK SQL_DISABLE_DIRSYNC SQL_OMIT_AUTOMATIC_INDEX SQL_DEBUG_SORTER_THREADS SQL_DEFAULT_WORKER_THREADS SQL_LIMIT_WORKER_THREADS SQL_MAX_WORKER_THREADS References: <488B1A8C-A7EE-4361-A2D6-EA7796E77728@tarantool.org> From: Stanislav Zudin Message-ID: Date: Wed, 29 May 2019 17:02:17 +0300 MIME-Version: 1.0 In-Reply-To: <488B1A8C-A7EE-4361-A2D6-EA7796E77728@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org, "n.pettik" On 19.05.2019 18:16, n.pettik wrote: > >> diff --git a/src/box/sql/CMakeLists.txt b/src/box/sql/CMakeLists.txt >> index b9dbe141a..f988dc3e7 100644 >> --- a/src/box/sql/CMakeLists.txt >> +++ b/src/box/sql/CMakeLists.txt >> @@ -10,9 +10,6 @@ set(SQL_BIN_DIR ${CMAKE_BINARY_DIR}/src/box/sql) >> include_directories(${SQL_SRC_DIR}) >> include_directories(${SQL_BIN_DIR}) >> >> -add_definitions(-DSQL_MAX_WORKER_THREADS=0) >> -add_definitions(-DSQL_OMIT_AUTOMATIC_INDEX) > > Let’s keep routines connected with automatic indexes: > we are going to re-enable it in scope of > https://github.com/tarantool/tarantool/issues/2583 > This code is a good point to start with reincarnation. The macro SQL_OMIT_AUTOMATIC_INDEX and the code enabled by this macro returned back. > >> - >> set(TEST_DEFINITIONS >>     SQL_NO_SYNC=1 >>     SQL_TEST=1 >> >> diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h >> index f019cd291..4bf94fad2 100644 >> --- a/src/box/sql/sqlInt.h >> +++ b/src/box/sql/sqlInt.h >> >> @@ -4858,13 +4846,6 @@ int sqlMemdebugNoType(void *, u8); >> >> -/* >> - * Threading interface >> - */ >> -#if SQL_MAX_WORKER_THREADS>0 >> -int sqlThreadCreate(sqlThread **, void *(*)(void *), void *); >> -int sqlThreadJoin(sqlThread *, void **); >> -#endif > > Now we can remove struct sqlThread. Done. > >> diff --git a/src/box/sql/vdbesort.c b/src/box/sql/vdbesort.c >> index ddea6752c..a37fbd911 100644 >> --- a/src/box/sql/vdbesort.c >> +++ b/src/box/sql/vdbesort.c >> @@ -118,11 +118,6 @@ >>  * there are already N worker threads running, the main thread does >> the work >>  * itself. >>  * >> - * The sorter is running in multi-threaded mode if (a) the library >> was built >> - * with pre-processor symbol SQL_MAX_WORKER_THREADS set to a value >> greater >> - * than zero, and (b) worker threads have been enabled at runtime by >> calling >> - * "PRAGMA threads=N" with some value of N greater than 0. >> - * >>  * When Rewind() is called, any data remaining in memory is flushed to a >>  * final PMA. So at this point the data is stored in some number of sorted >>  * PMAs within temporary files on disk. >> @@ -159,15 +154,6 @@ >> #include "sqlInt.h" >> #include "vdbeInt.h" >> >> >> /* >>  * Hard-coded maximum amount of data to accumulate in memory before >> flushing >>  * to a level 0 PMA. The purpose of this limit is to prevent various >> integer >> @@ -297,18 +283,14 @@ struct MergeEngine { >>  * >>  * Before a background thread is launched, variable bDone is set to 0. >> Then, >>  * right before it exits, the thread itself sets bDone to 1. This is >> used for >> - * two purposes: > > bDone member is unused now. Done > >> @@ -885,8 +848,8 @@ sqlVdbeSorterInit(sql * db,/* Database connection >> (for malloc()) */ >> } else { >> pSorter->key_def = pCsr->key_def; >> pSorter->pgsz = pgsz = 1024; >> -pSorter->nTask = nWorker + 1; >> -pSorter->iPrev = (u8) (nWorker - 1); >> +pSorter->nTask = 1; > > nTask now always equals to 1, you can refactor code using it. > The same concerns member iPrev. > >> diff --git a/src/box/sql/wherecode.c b/src/box/sql/wherecode.c >> index 4dedb38a7..01fa138f6 100644 >> --- a/src/box/sql/wherecode.c >> +++ b/src/box/sql/wherecode.c >> @@ -253,14 +253,6 @@ sqlWhereExplainOneScan(Parse * pParse,/* Parse >> context */ >>       " USING INTEGER PRIMARY KEY (rowid%s?)", >>       zRangeOp); >> } >> -#ifdef SQL_EXPLAIN_ESTIMATED_ROWS >> -if (pLoop->nOut >= 10) { >> -sqlXPrintf(&str, " (~%llu rows)", >> -      sqlLogEstToInt(pLoop->nOut)); >> -} else { >> -sqlStrAccumAppend(&str, " (~1 row)", 9); >> -} >> -#endif > > We can enable this code, instead of removing it. > Done. See the PATCH v2 for changes.