Tarantool development patches archive
 help / color / mirror / Atom feed
From: Stanislav Zudin <szudin@tarantool.org>
To: tarantool-patches@freelists.org, "n.pettik" <korablev@tarantool.org>
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
Date: Wed, 29 May 2019 17:02:17 +0300	[thread overview]
Message-ID: <c3035c18-e491-8f33-ca0d-9629b3737e9d@tarantool.org> (raw)
In-Reply-To: <488B1A8C-A7EE-4361-A2D6-EA7796E77728@tarantool.org>



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.

  reply	other threads:[~2019-05-29 14:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 17:26 [tarantool-patches] [PATCH 0/8] sql: cleanup code from obsolete macros Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 1/8] " Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 2/8] Removes unused functions and commented many years ago code Stanislav Zudin
2019-05-19 15:15   ` [tarantool-patches] " n.pettik
2019-05-29  8:21     ` Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 3/8] Removes unused functions Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 4/8] Removes unused functions and macros Stanislav Zudin
2019-05-19 15:16   ` [tarantool-patches] " n.pettik
2019-05-29 14:01     ` Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 5/8] Removes the following unused macros: SQL_ENABLE_MEMORY_MANAGEMENT SQL_ENABLE_UNKNOWN_SQL_FUNCTION SQL_SUBSTR_COMPATIBILITY SQL_ENABLE_STMT_SCANSTATUS Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [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 Stanislav Zudin
2019-05-19 15:16   ` [tarantool-patches] " n.pettik
2019-05-29 14:02     ` Stanislav Zudin [this message]
2019-04-29 17:26 ` [tarantool-patches] [PATCH 7/8] Removes unused constants Stanislav Zudin
2019-04-29 17:26 ` [tarantool-patches] [PATCH 8/8] Removes the following unused macros: SQL_PRINTF_PRECISION_LIMIT SQL_OMIT_COMPOUND_SELECT SQL_POWERSAFE_OVERWRITE SQL_OMIT_PROGRESS_CALLBACK SQL_OMIT_AUTORESET SQL_OMIT_DECLTYPE SQL_ENABLE_COLUMN_METADATA SQL_TRACE_SIZE_LIMIT SQL_OMIT_LIKE_OPTIMIZATION SQL_OMIT_OR_OPTIMIZATION SQL_OMIT_BETWEEN_OPTIMIZATION Stanislav Zudin

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=c3035c18-e491-8f33-ca0d-9629b3737e9d@tarantool.org \
    --to=szudin@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --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' \
    /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