Add the OP_ReopenIdx opcode that works like OP_OpenRead except that it becomes
a no-op if the cursor is already open on the same index. Update the
OR-optimization logic to make use of OP_ReopenIdx in order to avoid
unnecessary cursor open requests sent to the B-Tree layer.
FossilOrigin-Name: 77f412caf0192d3e7fecb377d6d72123d8b64424
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 8f256d5..7edc04c 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -2136,6 +2136,7 @@
#define WHERE_DISTINCTBY 0x0200 /* pOrderby is really a DISTINCT clause */
#define WHERE_WANT_DISTINCT 0x0400 /* All output needs to be distinct */
#define WHERE_SORTBYGROUP 0x0800 /* Support sqlite3WhereIsSorted() */
+#define WHERE_REOPEN_IDX 0x1000 /* Try to use OP_ReopenIdx */
/* Allowed return values from sqlite3WhereIsDistinct()
*/