Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: "n.pettik" <korablev@tarantool.org>, tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 06/10] sql: completely remove support of partial indexes
Date: Sat, 25 Aug 2018 00:04:06 +0300	[thread overview]
Message-ID: <6efdbab9-a26d-2b6d-4d9f-6be13a0300d3@tarantool.org> (raw)
In-Reply-To: <47821985-7073-47BD-9235-207F782EEF1A@tarantool.org>

Thanks for the fixes! See my ones on the branch.

On 21/08/2018 19:31, n.pettik wrote:
> 
>> On 13 Aug 2018, at 23:24, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
>>
>> Thanks for the patch! I have pushed my review fixes in
>> a separate commit.
>>
>> Please, investigate also is it possible to remove pPartial
>> variable from constructAutomaticIndex? It would allow to
>> remove sql_resolve_part_idx_label alongside.
> 
> ConstructAutomatiIndex() is now dead code, so I can’t really check it.
> Lets now remove it. I doubt that this code can be adapted easily, so
> it is likely to be re-implemented anyway.
> 

diff --git a/src/box/sql/analyze.c b/src/box/sql/analyze.c
index 00d96d220..901951963 100644
--- a/src/box/sql/analyze.c
+++ b/src/box/sql/analyze.c
@@ -51,9 +51,9 @@
   * which the index belongs.  In each such row, the stat column will be
   * a string consisting of a list of integers.  The first integer in this
   * list is the number of rows in the index.  (This is the same as the
- * number of rows in the table, except for partial indices.)  The second
- * integer is the average number of rows in the index that have the same
- * value in the first column of the index.  The third integer is the average
+ * number of rows in the table.)  The second integer is the
+ * average number of rows in the index that have the same value in
+ * the first column of the index.  The third integer is the average
   * number of rows in the index that have the same value for the first two
   * columns.  The N-th integer (for N>1) is the average number of rows in
   * the index which have the same value for the first N-1 columns.  For
diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c
index a41ea8f13..50505b1d3 100644
--- a/src/box/sql/expr.c
+++ b/src/box/sql/expr.c
@@ -3700,7 +3700,7 @@ sqlite3ExprCodeTarget(Parse * pParse, Expr * pExpr, int target)
  			int iTab = pExpr->iTable;
  			if (iTab < 0) {
  				if (pParse->ckBase > 0) {
-					/* Generating CHECK constraints or inserting into partial index */
+					/* Generating CHECK constraints. */
  					return pExpr->iColumn + pParse->ckBase;
  				} else {
  					/* Coding an expression that is part of an index where column names
diff --git a/src/box/sql/resolve.c b/src/box/sql/resolve.c
index 97b642723..9a2d6ff4e 100644
--- a/src/box/sql/resolve.c
+++ b/src/box/sql/resolve.c
@@ -514,11 +514,13 @@ notValid(Parse * pParse,	/* Leave error message here */
  {
  	assert((validMask & ~(NC_IsCheck | NC_IdxExpr)) == 0);
  	if ((pNC->ncFlags & validMask) != 0) {
-		const char *zIn = "partial index WHERE clauses";
+		const char *zIn;
  		if (pNC->ncFlags & NC_IdxExpr)
  			zIn = "index expressions";
  		else if (pNC->ncFlags & NC_IsCheck)
  			zIn = "CHECK constraints";
+		else
+			unreachable();
  		sqlite3ErrorMsg(pParse, "%s prohibited in %s", zMsg, zIn);
  	}
  }
diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index d22f4e0a9..849c0f871 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -6247,7 +6247,7 @@ sqlite3Select(Parse * pParse,		/* The parser context */
  				 * optimized specially. The OP_Count instruction
  				 * is executed on the primary key index,
  				 * since there is no difference which index
-				 * to choose (except for partial indexes).
+				 * to choose.
  				 */
  				const int cursor = pParse->nTab++;
  				/*
diff --git a/src/box/sql/whereInt.h b/src/box/sql/whereInt.h
index 548cbcb2a..889a667ae 100644
--- a/src/box/sql/whereInt.h
+++ b/src/box/sql/whereInt.h
@@ -538,4 +538,3 @@ void sqlite3WhereTabFuncArgs(Parse *, struct SrcList_item *, WhereClause *);
  #define WHERE_AUTO_INDEX   0x00004000	/* Uses an ephemeral index */
  #define WHERE_SKIPSCAN     0x00008000	/* Uses the skip-scan algorithm */
  #define WHERE_UNQ_WANTED   0x00010000	/* WHERE_ONEROW would have been helpful */
-#define WHERE_PARTIALIDX   0x00020000	/* The automatic index is partial */
diff --git a/src/box/sql/wherecode.c b/src/box/sql/wherecode.c
index 10a3f2d95..b45ca7cbe 100644
--- a/src/box/sql/wherecode.c
+++ b/src/box/sql/wherecode.c
@@ -231,8 +231,6 @@ sqlite3WhereExplainOneScan(Parse * pParse,	/* Parse context */
  				if (isSearch) {
  					zFmt = "PRIMARY KEY";
  				}
-			} else if (flags & WHERE_PARTIALIDX) {
-				zFmt = "AUTOMATIC PARTIAL COVERING INDEX";
  			} else if (flags & WHERE_AUTO_INDEX) {
  				zFmt = "AUTOMATIC COVERING INDEX";
  			} else if (flags & WHERE_IDX_ONLY) {

  reply	other threads:[~2018-08-24 21:04 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-12 14:12 [tarantool-patches] [PATCH 00/10] sql: cleanup in struct Index and struct Table Nikita Pettik
2018-08-12 14:12 ` [tarantool-patches] [PATCH 01/10] sql: remove suport of ALTER TABLE ADD COLUMN Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:12 ` [tarantool-patches] [PATCH 02/10] sql: remove string of fields collation from Table Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:12 ` [tarantool-patches] [PATCH 03/10] sql: remove index hash from struct Table Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:13 ` [tarantool-patches] [PATCH 04/10] sql: remove flags " Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:13 ` [tarantool-patches] [PATCH 05/10] sql: remove affinity string of columns from Index Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31     ` n.pettik
2018-08-24 21:04       ` Vladislav Shpilevoy
2018-08-26 19:45         ` n.pettik
2018-08-12 14:13 ` [tarantool-patches] [PATCH 06/10] sql: completely remove support of partial indexes Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31     ` n.pettik
2018-08-24 21:04       ` Vladislav Shpilevoy [this message]
2018-08-26 19:44         ` n.pettik
2018-08-12 14:13 ` [tarantool-patches] [PATCH 07/10] sql: remove index type from struct Index Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31     ` n.pettik
2018-08-12 14:13 ` [tarantool-patches] [PATCH 08/10] sql: use secondary indexes to process OP_Delete Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-12 14:13 ` [tarantool-patches] [PATCH 09/10] sql: disable ON CONFLICT actions for indexes Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31     ` n.pettik
2018-08-24 21:04       ` Vladislav Shpilevoy
2018-08-26 19:44         ` n.pettik
2018-08-27 17:24           ` Vladislav Shpilevoy
2018-08-12 14:13 ` [tarantool-patches] [PATCH 10/10] sql: move autoincrement field number to server Nikita Pettik
2018-08-13 20:24   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-21 16:31     ` n.pettik
2018-08-24 21:03       ` Vladislav Shpilevoy
2018-08-26 19:44         ` n.pettik
2018-08-27 17:24           ` Vladislav Shpilevoy
2018-08-27 17:24 ` [tarantool-patches] Re: [PATCH 00/10] sql: cleanup in struct Index and struct Table Vladislav Shpilevoy
2018-08-29 14:11 ` Kirill Yukhin

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=6efdbab9-a26d-2b6d-4d9f-6be13a0300d3@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 06/10] sql: completely remove support of partial indexes' \
    /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