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 965172E3AA for ; Sun, 19 May 2019 11:16:13 -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 RcS-DoJ6eTyq for ; Sun, 19 May 2019 11:16:13 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 2CBE828C07 for ; Sun, 19 May 2019 11:16:13 -0400 (EDT) From: "n.pettik" Message-Id: <488B1A8C-A7EE-4361-A2D6-EA7796E77728@tarantool.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_6584D850-1F01-4CFE-8B10-B0886E91B24B" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) 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: Sun, 19 May 2019 18:16:11 +0300 In-Reply-To: References: 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 Cc: szudin@tarantool.org --Apple-Mail=_6584D850-1F01-4CFE-8B10-B0886E91B24B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > 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}) >=20 > -add_definitions(-DSQL_MAX_WORKER_THREADS=3D0) > -add_definitions(-DSQL_OMIT_AUTOMATIC_INDEX) Let=E2=80=99s 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. > - > set(TEST_DEFINITIONS > SQL_NO_SYNC=3D1 > SQL_TEST=3D1 >=20 > 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 >=20 > @@ -4858,13 +4846,6 @@ int sqlMemdebugNoType(void *, u8); >=20 > -/* > - * 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. > 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=3DN" 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" >=20 >=20 > /* > * 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. > @@ -885,8 +848,8 @@ sqlVdbeSorterInit(sql * db, /* Database = connection (for malloc()) */ > } else { > pSorter->key_def =3D pCsr->key_def; > pSorter->pgsz =3D pgsz =3D 1024; > - pSorter->nTask =3D nWorker + 1; > - pSorter->iPrev =3D (u8) (nWorker - 1); > + pSorter->nTask =3D 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 >=3D 10) { > - sqlXPrintf(&str, " (~%llu rows)", > - sqlLogEstToInt(pLoop->nOut)); > - } else { > - sqlStrAccumAppend(&str, " (~1 row)", 9); > - } > -#endif We can enable this code, instead of removing it. --Apple-Mail=_6584D850-1F01-4CFE-8B10-B0886E91B24B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

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=3D0)
-add_definitions(-DSQL_OMIT_AUTOMATIC_INDEX)

Let=E2=80= =99s 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.

-
set(TEST_DEFINITIONS
=     SQL_NO_SYNC=3D1
=     SQL_TEST=3D1

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.

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=3DN" 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.

@@ -885,8 +848,8 @@ sqlVdbeSorterInit(sql * db, /* = Database connection (for malloc()) */
} else = {
= = pSorter->key_def =3D pCsr->key_def;
= pSorter->pgsz =3D pgsz =3D 1024;
- = pSorter->nTask =3D nWorker + 1;
- = pSorter->iPrev =3D (u8) (nWorker - 1);
+ = pSorter->nTask =3D 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 >=3D 10) {
- = sqlXPrintf(&str, " (~%llu rows)",
- =       sqlLogEstToInt(pLoop->nOut));
- = = } else {
- sqlStrAccumAppend(&str, " (~1 = row)", 9);
- }
-#endif

We = can enable this code, instead of removing it.

= --Apple-Mail=_6584D850-1F01-4CFE-8B10-B0886E91B24B--