/ History for src/where.c
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History for src/where.c

, (SELECT ... FROM tbl WHERE rowid > ) FROM ...". (CVS 5855) (check-in: [6c918c4e] user: danielk1977 branch: trunk, size: 107396)
2020-06-03
03:00
[7bcc07ff] part of check-in [d901837f] Improve the query planner so that it is better able to find full index scan plan when there is an INDEXED BY clause. (check-in: [d901837f] user: drh branch: trunk, size: 208226)
2020-03-16
03:07
[9546c820] part of check-in [8b437b47] At the end of the right-hand table loop of a LEFT JOIN that uses an IN operator in the ON clause, put the OP_IfNoHope operator after the OP_IfNotOpen operator, not before, to avoid a (harmless) uninitialized register reference. Ticket [82b588d342d515d1] (check-in: [8b437b47] user: drh branch: trunk, size: 208194)
2020-03-12
17:54
[3946de6a] part of check-in [ea914bec] Remove stray comment characters at the end of an #ifdef that were accidently left in the previous check-in. (check-in: [ea914bec] user: drh branch: trunk, size: 208150)
17:28
[8e428354] part of check-in [23174921] Fix comments and strengthen assert() statements associated with the OPFLAG_SEEKEQ and BTREE_SEEK_EQ flags. (check-in: [23174921] user: drh branch: trunk, size: 208152)
2020-02-24
16:46
[3b8c9bd0] part of check-in [4558163b] Rework this changes so that instead of setting the WhereTerm.truthProb when a term is seen to be of low selectivity, it merely sets a new flag (the TERM_HIGHTRUTH flag) which causes whereLoopOutputAdjust() to ignore that term. (check-in: [4558163b] user: drh branch: stat4-truthprob, size: 208171)
2020-02-22
18:27
[44695e87] part of check-in [c535fea1] Do not activate the truthProb adjustment mechanism if the truth probability is less than the heuristic value, as there could be correlations unknown to stat4. Also add additional tracing output to make truthProb adjustments more visible. (check-in: [c535fea1] user: drh branch: stat4-truthprob, size: 208222)
16:58
[74a2fc5a] part of check-in [1babd6ec] When stat4 information is available, try to use it to improve the truth probability of WHERE clause terms that do not participate in the index. (check-in: [1babd6ec] user: drh branch: stat4-truthprob, size: 207580)
2020-02-13
14:51
[cbad14f1] part of check-in [e0c6b8bd] Disallow the skip-scan optimization in the absence of sqlite_stat1 data. (check-in: [e0c6b8bd] user: drh branch: trunk, size: 206015)
11:46
[23c7744a] part of check-in [abfb043e] Fix an incorrect assert() statement that was added yesterday. Tickets [41c1456a6e61c0e7] and [fb8c538a8f57ae2a]. (check-in: [abfb043e] user: drh branch: trunk, size: 205989)
2020-02-12
11:57
[8fed0ab2] part of check-in [16aed5d0] When determining whether an == or IS constraint in a WHERE clause makes an ORDER BY term redundant, consider the collation sequence used by the == or IS comparison, not the collation sequence of the comparison expression itself. Possible fix for [fb8c538a8f]. (check-in: [16aed5d0] user: dan branch: trunk, size: 206017)
2020-01-16
12:25
[2005d051] part of check-in [86b5e5a2] Fix an SQL syntax error in the comment on the omit-left-join optimization. No changes to code. (check-in: [86b5e5a2] user: drh branch: trunk, size: 205810)
2020-01-06
17:33
[df2bea0e] part of check-in [d7126a9c] Do not attempt to use the skip-scan optimization if prior terms of the index are already used for non-equality constraints. Ticket [304017f5f04a0035] (check-in: [d7126a9c] user: drh branch: trunk, size: 205819)
2020-01-04
16:55
[4ca6c066] part of check-in [95ef6896] Fix a problem where the loop for the RHS of a LEFT JOIN uses values from an IN() clause as the second or subsequent field of an index. (check-in: [95ef6896] user: dan branch: trunk, size: 205745)
2020-01-02
00:45
[9353093c] part of check-in [7bfd42f1] The sqlite3WhereEnd() call now unwinds all Expr modifications made by the sqlite3WhereBegin(). (check-in: [7bfd42f1] user: drh branch: trunk, size: 204924)
2019-12-29
00:52
[602e5093] part of check-in [21ef6e99] Add the OP_FinishSeek opcode which completes an OP_DeferredSeek if the seek has not already completed. Also add the sqlite3WhereUsesDeferredSeek() interface to the query planner. The UPDATE implementation adds an OP_FinishSeek before running the final OP_Insert if one is needed. Ticket [ec8abb025e78f40c] and also an assertion fault reported by Yongheng. (check-in: [21ef6e99] user: drh branch: trunk, size: 204664)
2019-12-28
15:24
[7bb294fd] part of check-in [f4bed1d7] Fix an instance where the planner might choose to use the OR-optimization when it adds no benefit. The same quirk causes an assert() to fail. This is not a bug in released versions - without the assert() the library still gets the right answer, it just does so less efficiently than it should. (check-in: [f4bed1d7] user: dan branch: trunk, size: 204436)
14:07
[97f19d66] part of check-in [59cc46e5] New enhancements to .wheretrace. The 0x20000 flag shows the WHERE clause before and after coding each loop. The 0x800 flag shows status at the start and at the end of each loop. An extra "C" tag is shown on coded terms. (check-in: [59cc46e5] user: drh branch: trunk, size: 204435)
13:39
[d1d79673] part of check-in [85e76887] Expose some of the Where data structure debug printing routines to the entire WHERE-clause processing module. (check-in: [85e76887] user: drh branch: trunk, size: 204287)
13:01
[230995f7] part of check-in [5e6357fc] Simplifications to the initialization of the sqlite3_index_info structure that is used to communicate with virtual table modules. Avoid adding unused constraints to the sqlite3_index_info structure. Extra constraints are harmless, but might be confusing to people trying to understand the code. (check-in: [5e6357fc] user: drh branch: trunk, size: 204224)
12:33
[476c0091] part of check-in [a4f330b1] If the ".wheretrace 0x10000" bit is set, print WhereTerm.prereqAll and .prereqRight fields in the WhereTerm trace output. (check-in: [a4f330b1] user: drh branch: trunk, size: 204618)
03:55
[2796f052] part of check-in [0d743585] Fix a faulty assert() associated with query search limiting query plans. (check-in: [0d743585] user: drh branch: trunk, size: 204474)
01:52
[e221a612] part of check-in [6afadd3b] When an INSERT is receiving content from a SELECT, run an OP_ReleaseReg opcode at the top of each iteration of the loop in order to prevent spurious OP_SCopy misuse complaints. Ticket [de4b04149b9fdeae] (check-in: [6afadd3b] user: drh branch: trunk, size: 204418)
2019-12-24
21:01
[58653781] part of check-in [ddb10f03] Backout the early VTable cursor close change from yesterday, as Yongheng and Rui have found a test case for which it fails. The new test case is added to fuzzcheck. (check-in: [ddb10f03] user: drh branch: trunk, size: 204416)
13:41
[ac6704a7] part of check-in [b473ad35] Convert an ALWAYS() into an assert() with an extra error term. Dbsqlfuzz find, with test case in TH3. (check-in: [b473ad35] user: drh branch: trunk, size: 204511)
2019-12-23
19:28
[c82db883] part of check-in [eb95dac7] Do an early close of virtual table cursors to avoid unnecessary cursor contention in UPDATE for some virtual table implementations. Ticket [56a74875be799b85] (check-in: [eb95dac7] user: drh branch: trunk, size: 204449)
2019-12-22
19:41
[25653002] part of check-in [7fc73332] In the WHERE clause debugging output (the .wheretrace output) show the parent index of any WhereTerm that is a child. (check-in: [7fc73332] user: drh branch: trunk, size: 204354)
2019-12-11
16:22
[c51ebd50] part of check-in [840de36d] Strengthen check-in [83da4d4104ee1870] by ignoring *all* WHERE-clause constraints for a virtual table that is the right table of a LEFT JOIN, as such constraints are never useful. This fixes an issue discovered by Manuel Rigger. (check-in: [840de36d] user: drh branch: trunk, size: 204277)
2019-12-06
11:48
[bb2d3c08] part of check-in [62f2235a] The check-in [b7810062ec2489e1] was not quite right in that it allowed an oversized shift operation (which is UB in C) on some obscure inputs. OSSFuzz found the problem for us overnight. (check-in: [62f2235a] user: drh branch: trunk, size: 204451)
2019-12-05
21:46
[b9f5acc5] part of check-in [b7810062] Fix to the rowvalue logic that avoids disabling rowvalue inequality contraints on a virtual table when the virtual table sets the omit flag. The logic has been incorrect since row-values were added. However, this does not come up often as very few virtual tables implement inequality constraints using the omit flag. Ticket [f096d191b6641daa] (check-in: [b7810062] user: drh branch: trunk, size: 204455)
17:31
[6807232f] part of check-in [fc72ec52] Additional debugging information printed with the ".wheretrace 0x100" option. No changes to normally delivered code. (check-in: [fc72ec52] user: drh branch: trunk, size: 204323)
2019-11-30
19:29
[2a5389e7] part of check-in [4066a34d] Do not allow a term in the WHERE clause of the query to qualify a partial index on the right table of a LEFT JOIN. Ticket [7f39060a24b47353] (check-in: [4066a34d] user: drh branch: trunk, size: 204025)
2019-11-08
20:13
[874845fb] part of check-in [b59f94e4] When a virtual table reports orderByConsumed, that tells us nothing about whether or not the SQLITE_DISTINCTBY constraint is met. Fix for ticket [7e59041f9c4e5102]. Test cases in TH3. (check-in: [b59f94e4] user: drh branch: trunk, size: 203627)
2019-11-01
15:19
[6e56bef9] part of check-in [e6c96ed9] Omit the optimization that reduces the column-count on rowid-table cursors when the table has generated columns, because we do not know what columns the generator expressions might try to access. (check-in: [e6c96ed9] user: drh branch: trunk, size: 203572)
2019-10-22
12:02
[6ff3ef07] part of check-in [ba123b8c] Merge changes on trunk into the generated-columns branch. (check-in: [ba123b8c] user: drh branch: generated-columns, size: 203311)
00:03
[148fa1ce] part of check-in [90f7c477] When flipping ("commuting") a comparison operator, set the new EP_Commuted bit rather than adding extra EP_Collate bits, to single later processing that the order of precedence for COLLATE operators is inverted. Fix for ticket [b47e3627ecaadbde] (check-in: [90f7c477] user: drh branch: trunk, size: 203172)
2019-10-19
15:01
[9ab20610] part of check-in [fb9c9bb2] Add testcase macros. (check-in: [fb9c9bb2] user: drh branch: generated-columns, size: 203468)
13:29
[7b2d928b] part of check-in [27ab41c9] Refactor names of column index transformation functions, for clarity. Get generated columns working with ALTER TABLE RENAME COLUMN. (check-in: [27ab41c9] user: drh branch: generated-columns, size: 203404)
2019-10-18
17:42
[b7c662af] part of check-in [9f409649] Get generated columns working for WITHOUT ROWID tables. (check-in: [9f409649] user: drh branch: generated-columns, size: 203394)
2019-09-18
12:49
[9f3f23ef] part of check-in [633b214e] Fix another potential "jump depends on uninitialized value" warning. (check-in: [633b214e] user: drh branch: trunk, size: 203329)
2019-09-03
14:27
[9685d598] part of check-in [5351e920] When we play games with COLLATE in order to commute an operator in the WHERE clause processing, be sure not to use the commuted operator to qualify a partial index, as insufficient COLLATE information is preserved to verify that the expression will correctly qualify the index. Ticket [767a8cbc6d20bd68] (check-in: [5351e920] user: drh branch: trunk, size: 203311)
2019-08-29
21:16
[fb546afb] part of check-in [e8e9f77d] Improve vdbe branch coverage of NULLS LAST code. (check-in: [e8e9f77d] user: dan branch: trunk, size: 203248)
16:48
[0a573a77] part of check-in [33da6092] Add a missing VdbeCoverage() macro. (check-in: [33da6092] user: drh branch: trunk, size: 203245)
2019-08-27
19:59
[6f8bd0b4] part of check-in [94085fb3] Add support for "ORDER BY ... NULLS FIRST" and "ORDER BY ... NULLS LAST". Use this to fix ticket [f8a7060e]. (check-in: [94085fb3] user: dan branch: trunk, size: 203220)
17:28
[b33215cc] part of check-in [aff20980] Add ALWAYS() to an always true conditional that results from the previous check-in. Add a test case for ticket [dbaf8a6820be1ece] to supplement those already checked into TH3. (check-in: [aff20980] user: drh branch: trunk, size: 202723)
17:01
[6cc2708a] part of check-in [7f5168a7] Omit the "x IN (y)" to "x==y" optimization of check-in [e68b427afbc82e20] (and ticket [e39d032577df6942]) as it causes difficult affinity problems as demonstrated by ticket [dbaf8a6820be1ece] and the original assertion fault is no longer a factor due to countless other changes of the previous 5 years. (check-in: [7f5168a7] user: drh branch: trunk, size: 202715)
2019-08-23
13:32
[10e21ac3] part of check-in [bf875e1a] Invert the meaning of the regBignull flag so that it is 1 when doing the normal scan and 1 when scanning nulls. This enables the re-do jump at the bottom of the loop to be coded with a single OP_IfNotZero opcode, rather than a sequence of OP_If, OP_Integer, OP_Goto. (check-in: [bf875e1a] user: drh branch: nulls-last, size: 203358)
13:08
[cba20474] part of check-in [649b08ea] Extra VDBE comments in the NULLS LAST logic provide landmarks to help understand the EXPLAIN output. (check-in: [649b08ea] user: drh branch: nulls-last, size: 203621)
2019-08-22
19:35
[e954bdbd] part of check-in [63e625c8] Merge fixes from trunk. Also fix a reference to the KeyInfo.aSortOrder field, which should now be KeyInfo.aSortFlags (check-in: [63e625c8] user: drh branch: nulls-last, size: 203528)
16:38
[c35ad5b7] part of check-in [44578865] Fix the likely(), unlikely(), and likelihood() functions so that they have no affinity, just like any other function. Ticket [7e07a3dbf5a8cd26] (check-in: [44578865] user: drh branch: trunk, size: 202853)
2019-08-21
19:58
[b49039ad] part of check-in [b1cbcdc6] Add missing VdbeCoverage() macros to new code. (check-in: [b1cbcdc6] user: dan branch: nulls-last, size: 203458)
15:41
[efdaf72c] part of check-in [6153bcf4] Update this branch with latest trunk changes. (check-in: [6153bcf4] user: dan branch: nulls-last, size: 203598)
14:54
[16c649c1] part of check-in [d02490a2] Avoid assuming that "column IS ?", where column is declared UNIQUE, matches only a single row (as "?" might be NULL). Fix for [b8689402]. (check-in: [d02490a2] user: dan branch: trunk, size: 202783)
2019-08-20
15:47
[391e856e] part of check-in [a9a82ee8] Do not pass ORDER BY clauses with non-standard NULL handling to virtual table implementations. (check-in: [a9a82ee8] user: dan branch: nulls-last, size: 203285)
2019-08-17
15:47
[52c43320] part of check-in [db1e6080] Merge trunk changes into this branch. (check-in: [db1e6080] user: dan branch: nulls-last, size: 203217)
2019-08-16
21:07
[c4ec1162] part of check-in [81069d71] Add support for using indexes for some ORDER BY clauses that use non-default NULL handling. Still some problems on this branch. (check-in: [81069d71] user: dan branch: nulls-last, size: 203179)
2019-08-15
14:35
[2fac51d2] part of check-in [98357d8c] Ensure that the optional "sz=N" parameter that can be manually added to the end of an sqlite_stat1 entry does not have an N value that is too small. Ticket [e4598ecbdd18bd82] (check-in: [98357d8c] user: drh branch: trunk, size: 202470)
2019-08-12
16:36
[83fc2aca] part of check-in [07babb0f] Experimental implementation of NULLS FIRST/LAST. This branch still has problems - the most significant of which is that ORDER BY clauses with a non-default NULLS FIRST/LAST qualifier can never use an index. (check-in: [07babb0f] user: dan branch: nulls-last, size: 202603)
2019-08-08
16:23
[90cb93dc] part of check-in [845d2f17] More legacy STAT3 code removed. (check-in: [845d2f17] user: drh branch: omit-stat3, size: 202432)
15:24
[bda7162b] part of check-in [1e17ea2f] Remove support for STAT3. The sqlite_stat3 tables are ignored, if they exist. STAT4 continues to work as it always has, and as it is a superset of STAT3 is the recommended replacement. (check-in: [1e17ea2f] user: drh branch: omit-stat3, size: 202426)
2019-08-06
14:37
[b6055f47] part of check-in [e8234f69] Use 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columns with no affinity can appear in a zero-terminated string. Use the new SQLITE_AFF_NONE macro for this new magic number. (check-in: [e8234f69] user: drh branch: pending, size: 202566)
2019-08-03
16:37
[dee31d68] part of check-in [d465c3ee] Fix a problem with queries of the form "SELECT min(<expr>) ... WHERE <expr>=?" where there is an index on <expr>. Fix for [71e183ca]. (check-in: [d465c3ee] user: dan branch: trunk, size: 202530)
16:17
[57a9b7b3] part of check-in [fd598e47] In the ".wheretrace 0x100" debugging mode, show the structure of the main parameters to sqlite3WhereBegin() calls. (check-in: [fd598e47] user: drh branch: trunk, size: 202394)
2019-07-30
14:22
[01b68cfc] part of check-in [89bf0399] Improved fix for ticket [ced41c7c7d6b4d36] that keeps skip-scan enabled, but avoids identifying a skip-scan as order-distinct (because it is not) and thus forces a separate b-tree to implement the DISTINCT clause of a query. This undoes check-in [a871d69c6de65038] and substitutes a new fix. (check-in: [89bf0399] user: drh branch: trunk, size: 202068)
01:17
[03125c70] part of check-in [a871d69c] Disable the skip-scan optimization for DISTINCT queries. Fix for ticket [ced41c7c7d6b4d36] (check-in: [a871d69c] user: drh branch: trunk, size: 202073)
2019-07-29
14:42
[a3c9a0e1] part of check-in [b4716931] When using an index for both DISTINCT and ORDER BY, do not confuse the number of columns required for distinctness with the number required to get the correct sort order. Fix for [6749cb3c]. (check-in: [b4716931] user: dan branch: tkt-6749cb3c, size: 202002)
2019-07-16
19:44
[2f508c9a] part of check-in [9e664585] Add new assert() statements in an attempt to help static analyzers avoid false-positives. (check-in: [9e664585] user: drh branch: trunk, size: 201890)
2019-06-28
07:08
[2f11eeb1] part of check-in [eab42975] Use the OP_Sequence opcode for generating unique rowid values for an autoindex on a co-routine implementation of a subquery. (check-in: [eab42975] user: drh branch: trunk, size: 201866)
2019-04-26
17:20
[3e9689df] part of check-in [1b25fa10] An experimental interface for retrieving the estimated cost and estimated number of output rows for a query. (check-in: [1b25fa10] user: drh branch: cost-est, size: 202051)
2019-04-19
13:38
[99c7b718] part of check-in [7713996a] Streamline the processing of the AND operator. Slightly smaller and faster. (check-in: [7713996a] user: drh branch: trunk, size: 201935)
2019-03-29
13:17
[ff2955dc] part of check-in [f5752517] Fix a fairly obscure problem causing the planner to sometimes choose sub-optimal plans for a query with a single virtual table in the FROM clause, and at least one IN(...) constraint in the WHERE clause. (check-in: [f5752517] user: dan branch: trunk, size: 201939)
2019-01-28
18:58
[8a207cb2] part of check-in [c4db0ad1] Fix a performance regression caused by the previous commit. (check-in: [c4db0ad1] user: drh branch: index-on-cast, size: 201893)
18:08
[c91b3dd6] part of check-in [3ef711d9] Make indexes on CAST(...) expressions work. (check-in: [3ef711d9] user: dan branch: index-on-cast, size: 201421)
2019-01-22
18:20
[e575883d] part of check-in [8790368b] Add the SQLITE_ENABLE_EARLY_CURSOR_CLOSE compile-time option which causes read cursors to be closed after their usefulness ends during a two-pass UPDATE. (check-in: [8790368b] user: mistachkin branch: branch-3.26, size: 201124)
2019-01-17
19:33
[c5d20169] part of check-in [7def6c8e] Add the SQLITE_ENABLE_EARLY_CURSOR_CLOSE compile-time option which causes read cursors to be closed after their usefulness ends during a two-pass UPDATE. (check-in: [7def6c8e] user: drh branch: trunk, size: 201361)
2019-01-15
14:31
[dc293ea4] part of check-in [ecf5caa7] Fix a problem triggered by DELETE statements with WHERE clauses that use the OR-optimization on some virtual tables. (check-in: [ecf5caa7] user: dan branch: trunk, size: 200527)
2019-01-10
13:56
[7a1db797] part of check-in [e22d2f90] Use the new SQLITE_IDXTYPE_IPK values (3) on Index.idxType to indicate the fake INTEGER PRIMARY KEY index used during query planning. (check-in: [e22d2f90] user: drh branch: trunk, size: 200448)
2018-12-31
18:30
[981412c2] part of check-in [9fb646f2] Merge enhancements and bug fixes from trunk. (check-in: [9fb646f2] user: drh branch: reuse-subqueries, size: 200349)
2018-12-29
02:26
[ebdd5937] part of check-in [4a0929ac] A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewer memory allocations by deferring memory allocation until sqlite3VdbeResolveLabel() is called, at which point the code generator has a better idea of how big the relocation table needs to be. The sqlite3VdbeMakeLabel() routine now takes a Parse* parameter instead of Vdbe*. (check-in: [4a0929ac] user: drh branch: trunk, size: 200300)
2018-12-25
00:15
[bf0715a8] part of check-in [3c2ad0e9] Increase the number of parameters to sqlite3WhereCodeOneLoopStart() to encourage the compiler to inline that routine within sqlite3WhereBegin(). This gives a performance improvement. (check-in: [3c2ad0e9] user: drh branch: reuse-subqueries, size: 200339)
2018-12-24
02:34
[05877bee] part of check-in [6c44838a] Experimental code that tries to put the computation of subqueries inside a subroutine, and reuse that subroutine if the same subquery is evaluated more than once. Current code does not work for CHECK constraints. (check-in: [6c44838a] user: drh branch: reuse-subqueries, size: 200325)
2018-12-14
20:20
[8a445862] part of check-in [b29e02f8] Add the OP_ColumnsUsed opcode (when compiled with SQLITE_ENABLE_COLUMN_USED_MASK) as a hint to the b-tree layer as to which columns of a btree cursor will be used. (Backport from 3.8.11) (check-in: [b29e02f8] user: drh branch: branch-3.8.9, size: 270904)
2018-11-20
16:02
[fded04f3] part of check-in [dfab7170] Consolidate the two sqlite3SchemaToIndex() routines. (check-in: [dfab7170] user: dan branch: reuse-schema1, size: 200445)
2018-11-19
20:41
[9cf0501b] part of check-in [84be9220] Fix a problem with virtual tables in shared schemas. (check-in: [84be9220] user: dan branch: reuse-schema1, size: 200447)
2018-11-17
18:45
[0248d446] part of check-in [9fdd1868] Merge latest trunk changes into this branch. (check-in: [9fdd1868] user: dan branch: reuse-schema1, size: 200312)
14:19
[3818e8a7] part of check-in [645232f2] Remove a C++-style comment. (check-in: [645232f2] user: drh branch: trunk, size: 200290)
2018-11-16
15:08
[053e5004] part of check-in [4372ad64] Update the generate_series() table-valued function to make use of the new SQLITE_CONSTRAINT return from xBestIndex. (check-in: [4372ad64] user: drh branch: trunk, size: 200366)
13:56
[23f955de] part of check-in [684013ce] Enhance the xBestIndex interface of virtual table so that if the xBestIndex method returns SQLITE_CONSTRAINT then that particular combination of constraints is considered unusable and does not participate further in query planning. (check-in: [684013ce] user: drh branch: trunk, size: 200297)
2018-11-15
21:20
[dc648e8b] part of check-in [31b6aee7] Fix some problems with the feature on this branch. Many problems remain. (check-in: [31b6aee7] user: dan branch: reuse-schema1, size: 200164)
2018-11-09
14:17
[f5da1079] part of check-in [531eca61] Fix for ticket [787fa716be3a7f650cac] (check-in: [531eca61] user: drh branch: trunk, size: 200142)
2018-10-05
20:09
[e34d423b] part of check-in [5c243eec] When the left-hand side of a WHERE clause contraint is a UNIQUE column, and that term of the WHERE clause is not used for indexing, assume that the term reduces the number of output rows by half. This is one proposed fix for ticket [e8b674241947eb3ba4] (check-in: [5c243eec] user: drh branch: unique-constraint-weights, size: 200840)
2018-10-04
18:17
[824ca57f] part of check-in [857a1b01] The 0x8000 optimization flag associated with SQLITE_TESTCTRL_OPTIMIZATIONS causes a large penalty (200) to be added to all sorting costs, which encourages the query planner avoid using the sorter. This flag can be used in experiments to help come up with a more accurate estimate of the true cost of sorting. (check-in: [857a1b01] user: drh branch: query-planner-debug, size: 200243)
2018-09-24
12:37
[a54a3d63] part of check-in [903e5018] Use compile-time options SQLITE_QUERY_PLANNER_LIMIT and SQLITE_QUERY_PLANNER_LIMIT_INCR to control the value for WhereLoopBuilder.iPlanLimit, rather than embedding magic numbers in the code. (check-in: [903e5018] user: drh branch: trunk, size: 200177)
10:47
[49022d3c] part of check-in [3dd35f51] Increase the initial value of WhereLoopBuilder.iPlanLimit to 20K. Issue a warning if the iPlanLimit reaches zero. (check-in: [3dd35f51] user: drh branch: trunk, size: 200589)
2018-09-22
15:05
[9e2cccc1] part of check-in [7b59930a] Enhance WhereLoopBuilder.iPlanLimit to handle a case involving the OR optimization discovered overnight by OSSFuzz. (check-in: [7b59930a] user: drh branch: trunk, size: 200514)
2018-09-21
18:43
[e5c4f5ab] part of check-in [8690b5a0] Put a limit counter on the query planner that restricts the number of index+constraint options that can be considered for each table in a join. This prevents certain pathological queries from taking up too much time in the query planner. (check-in: [8690b5a0] user: drh branch: trunk, size: 200376)
2018-09-19
14:54
[33a546a9] part of check-in [147c61a6] Reduce the size of Expr from 80 to 72 bytes moving the pRight field inside the "x" union. This is an incremental check-in that still has issues. (check-in: [147c61a6] user: drh branch: expr-simplify, size: 200136)
2018-09-18
21:35
[c90c392c] part of check-in [8849a463] In the Expr object, the Expr.eX field determines what value is stored in the Expr.x union. This mostly works, but there are issues identified by valgrind. (check-in: [8849a463] user: drh branch: expr-simplify, size: 199621)
2018-09-10
14:43
[20191268] part of check-in [3bbd9c5f] New testcase() macros on virtual table xBestIndex logic. (check-in: [3bbd9c5f] user: drh branch: trunk, size: 199545)
12:17
[07157267] part of check-in [83da4d41] Fix a problem with processing a "vtab.col IS NULL" expression within the WHERE clause of a query when "vtab" is a virtual table on the rhs of a LEFT JOIN. (check-in: [83da4d41] user: dan branch: trunk, size: 199453)
2018-09-08
20:29
[ff7f4024] part of check-in [5a954533] Fix an unreachable branch in the new sqlite3WhereOrderByLimitOptLabel() function of the query planner. (check-in: [5a954533] user: drh branch: trunk, size: 198985)
20:09
[5192013a] part of check-in [20672012] Fix multiple issues with the ORDER BY LIMIT optimization. This is the proposed resolution to ticket [9936b2fa443fec03ff25]. (check-in: [20672012] user: drh branch: trunk, size: 199001)
2018-08-03
23:04
[15580996] part of check-in [3f5f60cd] Completely remove the column cache logic, which has been a persistent source of bugs for many years. Due to recent enhancements to the performance of the OP_Column opcode, removing the column cache actually makes speed-check.sh run faster. Removing the column cache also saves about 1,800 bytes of code space. (check-in: [3f5f60cd] user: drh branch: omit-column-cache, size: 197820)
2018-07-28
21:01
[52ab6d07] part of check-in [85b9beb4] Add a small cost penalty to sorting to bias the query planner in favor of plans that do not require a final sorting pass. (check-in: [85b9beb4] user: drh branch: trunk, size: 197916)
2018-07-27
17:51
[fae13835] part of check-in [598d6083] Only run the constant propagation optimization on joins since that is the only scenario where it is useful. This saves prepare time for the common case of a simple query. (check-in: [598d6083] user: drh branch: propagate-const-opt, size: 197671)
2018-07-20
19:24
[2d313b44] part of check-in [489f3caf] Change the SQLITE_Stat34 bit of the optimization test-control so that it prevents STAT4 data from being used but allows it to be loaded into the Index objects. This permits STAT4 to be turned on and off on a per-statement basis. (check-in: [489f3caf] user: drh branch: trunk, size: 197663)
2018-07-12
19:14
[cd6710e2] part of check-in [650a3fe0] Add a test-control to disable the skip-scan optimization. (check-in: [650a3fe0] user: dan branch: trunk, size: 197557)
2018-07-10
19:48
[7afd00cf] part of check-in [a7cdc5bc] Identify Select objects within a single statement using small sequential integers rather than "0x%p". This is more readable and yields the same result on successive runs. (check-in: [a7cdc5bc] user: drh branch: trunk, size: 197510)
2018-07-04
14:28
[a38a485f] part of check-in [32924446] Experimental planner change to avoid a skip-scan if a regular index scan on the same index columns can be done instead. (check-in: [32924446] user: dan branch: exp-avoid-expensive-skipscan, size: 198388)
2018-06-11
17:35
[0bcbf9e1] part of check-in [b37614a3] Add the OP_SetTabCol and OP_VerifyTabCol opcodes, only when compiling with SQLITE_DEBUG, to do run-time verification of the column cache. (check-in: [b37614a3] user: drh branch: trunk, size: 197514)
2018-06-09
14:13
[fe1a6f97] part of check-in [31e480f6] Improved comments an presentation for the recent IN operator decision improvement. (check-in: [31e480f6] user: drh branch: trunk, size: 196560)
01:12
[99159295] part of check-in [d735872e] Compute the bitmask of indexed columns for each index once when the Index objecct is constructed, instead of recomputing it every time it is needed. (check-in: [d735872e] user: drh branch: trunk, size: 196464)
00:09
[b93db8c5] part of check-in [292724ff] Avoid invoking the whereLoopAddOr() routine in the query planner if there are no OR operators in the WHERE clause, thus speeding up query planning slightly. (check-in: [292724ff] user: drh branch: trunk, size: 196898)
2018-06-08
21:21
[e4d48338] part of check-in [30e87466] Only choose to scan an IN operator rather than use an index if we have real STAT1 data to suggest it is advantageous. (check-in: [30e87466] user: drh branch: in-scan-vs-index, size: 196874)
18:22
[8e95858b] part of check-in [1fa40a78] Consider doing a partial table scan to fulfill an IN operator rather than using an index. Try to pick the plan with the lowest cost. (check-in: [1fa40a78] user: drh branch: in-scan-vs-index, size: 196712)
2018-06-07
17:32
[7dcb13bb] part of check-in [439c8162] Remove the NextIfOpen and PrevIfOpen opcodes which are no longer needed when the IN-early-out optimization is working. (check-in: [439c8162] user: drh branch: multikey-opt-idea, size: 195335)
14:59
[6011e6a7] part of check-in [522f1eac] Add the WHERE_IN_EARLYOUT flag and use it to clarify the logic of this optimization. (check-in: [522f1eac] user: drh branch: multikey-opt-idea, size: 195347)
2018-06-05
20:45
[83b6cf94] part of check-in [6bf251af] Add the OP_IfNoHope and OP_SeekHit opcodes used to reduce the number of unnecessary sqlite3BtreeMovetoUnpacked() calls when checking for an early exit on IN-operator loops. Futher optimizations are likely possible here. (check-in: [6bf251af] user: drh branch: multikey-opt-idea, size: 195289)
15:16
[a16f982d] part of check-in [87a9fc50] Use an OP_NotFound opcode to cancel futile IN operators early. The current implementation is suboptimal because it always runs teh OP_NotFound. This still needs to be enhanced to only do the OP_NotFound if no results have been seen on the current loop. (check-in: [87a9fc50] user: drh branch: multikey-opt-idea, size: 195289)
2018-05-30
00:54
[a9a27099] part of check-in [92f0fe15] Demonstration code on a possible technique for optimizing the use of IN operator on columns to the right of multicolumn indexes. If the OP_Noop generated where were really a new opcode that checked to see if there existed any entries in the index with a matching prefix, it might prevent unnecessary iterations of the IN operator. (check-in: [92f0fe15] user: drh branch: multikey-opt-idea, size: 195194)
2018-05-14
22:46
[60ec752f] part of check-in [172f5bd2] Make more aggressive use of automatic indexes when processing materalized views and subqueries. (check-in: [172f5bd2] user: drh branch: trunk, size: 195036)
18:09
[95b25ef0] part of check-in [991a76bf] The restriction on using automatic indexes for low cardinality loops only applies if the cardinality is restricted by a LIMIT clause. (check-in: [991a76bf] user: drh branch: exp-indexed-clause, size: 194924)
17:12
[ebc86f31] part of check-in [32b3d110] Experimental syntax enhancement for an "INDEXED" keyword following a FROM-clause subquery that indicates that an automatic index on that subquery is suggested. (check-in: [32b3d110] user: drh branch: exp-indexed-clause, size: 194830)
2018-05-07
11:37
[d89b1aa5] part of check-in [374d8e26] Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic. (check-in: [374d8e26] user: drh branch: trunk, size: 194807)
2018-05-02
18:00
[8265aec8] part of check-in [5f0e803e] Fix test cases so that they work with the new EXPLAIN QUERY PLAN output format. Only some of the cases have been fixed. This is an incremental check-in. (check-in: [5f0e803e] user: drh branch: rework-EQP, size: 194832)
16:13
[aa94ef44] part of check-in [f2f52554] Improved EQP output for recursive CTEs and multi-value VALUES clauses. (check-in: [f2f52554] user: drh branch: rework-EQP, size: 194826)
2018-04-24
17:34
[7a1c5555] part of check-in [aeb694e3] Do not attempt to use terms from the WHERE clause to drive indexes on the right table of a LEFT JOIN. Fix for ticket [4ba5abf65c5b0f9a96a7a40cd18b] (check-in: [aeb694e3] user: drh branch: trunk, size: 194770)
2018-04-23
19:30
[2e8d9899] part of check-in [4df5ea93] Disable the OR optimization based on expressions in the ON clause of a LEFT JOIN. This is a temporary measure until we can devise a better fix. (check-in: [4df5ea93] user: drh branch: begin-concurrent-pnu-tempfix, size: 194380)
2018-04-09
15:57
[d6e5f205] part of check-in [9506ec14] Enhance the query planner so that it detects when the xBestIndex method of a virtual table gives out-of-sequence argvIndex values and reports an error. Secondary fix for ticket [2b8aed9f7c9e6]. (check-in: [9506ec14] user: drh branch: trunk, size: 194876)
13:58
[f24ffd41] part of check-in [ea2e5b34] Improvements to ".wheretrace" output. (check-in: [ea2e5b34] user: drh branch: trunk, size: 194526)
2018-01-31
14:07
[7cae47e8] part of check-in [74d857d1] Fix a failing assert() in the new code on this branch. (check-in: [74d857d1] user: dan branch: omit-left-join-fix, size: 194328)
2018-01-29
17:08
[eb378826] part of check-in [88411a40] Update the omit-left-join optimization so that it works in some cases when the RHS is subject to a UNIQUE but not NOT NULL constraint. (check-in: [88411a40] user: dan branch: omit-left-join-fix, size: 194392)
2018-01-27
05:40
[10c7e13c] part of check-in [eef8cbef] Proposed fix for the query planner problem of ticket [ec32177c99ccac2b1]. (check-in: [eef8cbef] user: drh branch: trunk, size: 194248)
2018-01-16
13:37
[caf0b6c9] part of check-in [feb2c2b6] Fix a problem causing an infinite loop or other malfunction in some UPDATE statements with an OR term in the WHERE clause. Ticket [47b2581aa9bfecec] (check-in: [feb2c2b6] user: dan branch: trunk, size: 194201)
2017-12-29
15:04
[36b92103] part of check-in [7a7f826e] Change the function name to sqlite_unsupported_offset(X). Only enable the function if compiled with -DSQLITE_ENABLE_OFFSET_SQL_FUNC. The makefiles add that definition to shell builds. (check-in: [7a7f826e] user: drh branch: location-function, size: 193351)
14:33
[9c1fca74] part of check-in [dd94d6a8] Enhance location(X) so that it works with indexes and WITHOUT ROWID tables. The function might return an offset to the main table or to an index, depending on whether the column X would be loaded from the main table or from the index. (check-in: [dd94d6a8] user: drh branch: location-function, size: 193292)
2017-12-22
00:52
[5876c910] part of check-in [5c1fe666] Modify the new sqlite3_vtab_collation() interface so that it takes a pointer to the sqlite3_index_info object passed into xBestIndex rather than an sqlite3 connection pointer, which the xBestIndex method might not have access to. (check-in: [5c1fe666] user: drh branch: trunk, size: 193264)
2017-12-19
18:56
[0cdfda28] part of check-in [ad38d2c4] Fix crash in sqlite3_vtab_collation() when called for an IS NOT NULL constraint. (check-in: [ad38d2c4] user: dan branch: trunk, size: 192755)
2017-12-16
19:16
[1617e7e4] part of check-in [d5b597b5] Merge latest trunk changes into this branch. (check-in: [d5b597b5] user: dan branch: schemalint, size: 192712)
2017-12-08
19:37
[ee9dd4a4] part of check-in [02013fc1] The query planner tries to avoids using indexes that use unknown collating functions. (check-in: [02013fc1] user: drh branch: trunk, size: 191514)
2017-12-07
22:10
[ea27cbc7] part of check-in [bbd69fa6] When doing a table scan using an index, do not error out if collating functions used by that index are unavailable, since they will not be used. (check-in: [bbd69fa6] user: drh branch: trunk, size: 191941)
2017-11-29
16:16
[a338038b] part of check-in [373fa21b] Merge latest trunk changes into this branch. (check-in: [373fa21b] user: dan branch: schemalint, size: 192675)
2017-11-23
04:45
[9752b68e] part of check-in [b016c28f] Fix a problem in the omit-table-from-left-join optimization from check-in [0cd82ee9a8413cf] that was discovered by OSSFuzz. (check-in: [b016c28f] user: drh branch: trunk, size: 191477)
00:45
[1b85f067] part of check-in [b7595cf2] Completely disable the skip-ahead-distinct optimization for all but the inner-most loop of a DISTINCT join. Fix for ticket [ef9318757b152e3a26e9592] (check-in: [b7595cf2] user: drh branch: trunk, size: 191277)
2017-11-21
23:47
[868c5b47] part of check-in [a33f88ac] An experimental optimization to DISTINCT that causes an immediate exit of the inner loop of a join following each output row if the inner loop does not contribute any columns to the result set. (check-in: [a33f88ac] user: drh branch: distinct-early-out, size: 192176)
23:38
[1c0ab207] part of check-in [2dcef5a9] Fix the skip-ahead-distinct optimization on joins for cases there the table in the inner loop of the join does not contribute any columns to the result set. Proposed fix for ticket [ef9318757b152e3a2] (check-in: [2dcef5a9] user: drh branch: trunk, size: 191590)
19:22
[9742731e] part of check-in [618ca9fe] Update the omit-table-from-left-join optimization so that it can omit tables from the middle of the join as well as the end. (check-in: [618ca9fe] user: dan branch: left-join-optimization, size: 191204)
2017-11-20
14:40
[e729f477] part of check-in [299d7ca5] Fix a problem preventing the planner from identifying scans that visit at most one row in cases where that property is guaranteed by a unique, not-null, non-IPK column that is the leftmost in its table. (check-in: [299d7ca5] user: dan branch: left-join-omit-fix, size: 189775)
2017-11-07
18:20
[031a80bc] part of check-in [292a0408] Fix a problem causing an INDEXED BY specifying an unusable partial index to be mishandled. (check-in: [292a0408] user: dan branch: trunk, size: 189774)
2017-10-31
03:40
[b7a075f5] part of check-in [1c80c75d] Remove unnecessary NEVER() and ALWAYS() conditionals. (check-in: [1c80c75d] user: drh branch: trunk, size: 189792)
2017-10-27
23:28
[ca5c29ba] part of check-in [0926df09] I was a little concerned about this check-in. Though I could not generate a failure myself, I thought it was risky. I checked it in for further testing. Then, overnight, OSSFuzz found a failure case for me. So the change is now moved out into a deadend branch. Was: Use OP_SCopy rather than OP_Copy to transfer results from a co-routine to its consumer. This undoes an earlier fix for ticket [98825a79ce] by check-in [ec6a06246e] because that problem no longer occurs due to WHERE clause push-down. (check-in: [0926df09] user: drh branch: mistake, size: 189826)
2017-10-16
11:50
[d8c6d690] part of check-in [700a3c69] Improved comments, including a typo fix, on the whereLoopCheaperProperSubset() function. (check-in: [700a3c69] user: drh branch: trunk, size: 189825)
2017-10-15
22:16
[248f0dc6] part of check-in [ee31c043] In the query planner, do not consider index X to be a proper subset of index Y if X is a covering index but Y is not. (check-in: [ee31c043] user: drh branch: trunk, size: 189673)
2017-10-12
14:13
[dd3be478] part of check-in [d325da6c] Update this branch to match latest trunk. (check-in: [d325da6c] user: dan branch: schemalint, size: 190705)
2017-10-11
20:26
[80b3f578] part of check-in [2719cf5c] Merge latest trunk changes with this branch. (check-in: [2719cf5c] user: dan branch: schemalint, size: 190733)
2017-09-28
01:58
[049522ad] part of check-in [490e488e] Add new routines to simplify dealing with collating sequences in expressions: sqlite3ExprNNCollSeq() and sqlite3ExprCollSeqMatch(). (check-in: [490e488e] user: drh branch: trunk, size: 189507)
01:09
[5b004ea3] part of check-in [04130018] Indexes on expressions with a COLLATE clause are able to satisfy an ORDER BY with the same COLLATE clause. (check-in: [04130018] user: drh branch: trunk, size: 189778)
00:01
[da814d09] part of check-in [80277d2f] In two places, change the magic number -1 to its proper symbol XN_ROWID. (check-in: [80277d2f] user: drh branch: trunk, size: 189753)
2017-09-15
14:36
[21eea981] part of check-in [f7f0bf1d] Fix a harmless comment typo. No changes to code. (check-in: [f7f0bf1d] user: drh branch: trunk, size: 189743)
2017-09-11
19:47
[d97f97ca] part of check-in [0fb992af] Refactor names of constants and functions associated with the auxiliary operators for xBestIndex. (check-in: [0fb992af] user: drh branch: vtab-extra-ops, size: 189746)
18:37
[3db249df] part of check-in [d3153abd] Minor adjustments to indentation and spacing for clarity. No changes to code. (check-in: [d3153abd] user: drh branch: vtab-extra-ops, size: 189807)
2017-09-09
19:41
[7cc9692d] part of check-in [34c8e952] Enhance the vtab interface to handle IS, !=, IS NOT, IS NULL and IS NOT NULL constraints. (check-in: [34c8e952] user: dan branch: vtab-extra-ops, size: 189812)
2017-09-04
00:33
[101f0a64] part of check-in [c7f9f47b] Proposed fix for ticket [b899b6042f97f5] (check-in: [c7f9f47b] user: drh branch: trunk, size: 189583)
2017-08-25
13:34
[0aaa1b08] part of check-in [39f708d1] Small performance optimization in sqlite3WhereBegin(). (check-in: [39f708d1] user: drh branch: trunk, size: 189538)
2017-08-18
08:29
[ad558533] part of check-in [37e19008] Only use indexes on expressions to optimize ORDER BY and GROUP BY if the collation sequence matches. Possible fix for [e20dd54a]. (check-in: [37e19008] user: dan branch: trunk, size: 189461)
2017-07-27
22:16
[3508f80b] part of check-in [2495acf7] Enhance the like optimization so that it works with an ESCAPE clause. (check-in: [2495acf7] user: drh branch: branch-3.8.9, size: 270165)
2017-07-18
17:13
[cbe8ddff] part of check-in [d2f0b2e8] Avoid creating an automatic index on the RHS of a LEFT JOIN to optimize an IS term. Fix for [ce68383b]. (check-in: [d2f0b2e8] user: dan branch: trunk, size: 189454)
2017-07-08
01:01
[5e7cf96b] part of check-in [d227de8a] Fix the covering index OR optimization (check-in [fcbd6abd]) so that it works with SQLITE_MAX_ATTACHED>30. Broken by a bad cherry-pick merge. (check-in: [d227de8a] user: drh branch: branch-3.8.9, size: 269140)
2017-07-05
16:20
[4ba13815] part of check-in [fcbd6abd] Make use of covering indexes in the OR optimization. (check-in: [fcbd6abd] user: drh branch: branch-3.8.9, size: 269129)
2017-07-04
19:34
[e7cc8094] part of check-in [d1ba2002] Add the count-of-view optimization when compiled using SQLITE_COUNTOFVIEW_OPTIMIZATION. (check-in: [d1ba2002] user: drh branch: trunk, size: 189137)
2017-06-28
18:25
[715b8491] part of check-in [a934dd14] Make the query planners use of partial indexes based on bound variables responsive to the SQLITE_DBCONFIG_ENABLE_QPSG setting. (check-in: [a934dd14] user: drh branch: partial-index-variables, size: 189096)
2017-06-24
18:10
[563cd034] part of check-in [7b59c353] Consider the values bound to SQL variables when determining whether or not a partial index may be used. (check-in: [7b59c353] user: dan branch: partial-index-variables, size: 189012)
16:03
[74b0a054] part of check-in [f0ec36d4] Query planner tuning: When deciding between two plans with the same cost, bias the selection toward the one that does not use the sorter. (check-in: [f0ec36d4] user: drh branch: trunk, size: 188967)
2017-06-22
16:51
[d4f329d9] part of check-in [e4a022be] When generating individual loops for each ORed term of an OR scan, move any constant WHERE expressions outside of the loop, as is done for top-level loops. (check-in: [e4a022be] user: dan branch: or-optimization, size: 188887)
2017-06-11
20:17
[aa213e1b] part of check-in [0bbdaf28] Fix an off-by-one error that messes up the display of loop codes in the ".wheretrace" debugging output for queries with more than 62 candidate loops when SQLITE_ENABLE_WHERETRACE is on. (check-in: [0bbdaf28] user: drh branch: trunk, size: 187817)
2017-05-24
04:32
[5b519760] part of check-in [19dad0a7] Fix a problem in STAT4 equality estimation for multi-column indexes introduced by check-in [3e0590dee0e68cc1599]. (check-in: [19dad0a7] user: drh branch: branch-3.8.9, size: 267202)
04:18
[67f98714] part of check-in [cfb0d9e0] Fix a problem in STAT4 equality estimation for multi-column indexes introduced by check-in [3e0590dee0e68cc1599]. (check-in: [cfb0d9e0] user: drh branch: trunk, size: 187813)
2017-05-22
00:45
[ba36d011] part of check-in [f261678c] When planning a query using sorting, resolve ties in the solver by selecting loop plans with the smaller unsorted cost. (check-in: [f261678c] user: drh branch: trunk, size: 187809)
00:27
[688071f7] part of check-in [962531e7] When planning a query using sorting, resolve ties in the solver by selecting loop plans with the smaller unsorted cost. (check-in: [962531e7] user: drh branch: branch-3.8.9, size: 267198)
2017-05-19
20:55
[a354396e] part of check-in [946b87a5] Improved comments on one routine in the query planner. Improved diagnostic output for ".wheretrace". No production code changes. (check-in: [946b87a5] user: drh branch: trunk, size: 187385)
2017-04-20
17:35
[a12df4e9] part of check-in [b1533bc4] Merge latest trunk changes into this branch. (check-in: [b1533bc4] user: dan branch: schemalint, size: 188543)
2017-04-18
11:20
[c6352f15] part of check-in [41c27bc0] Improved optimizations of views as the right operand of a LEFT JOIN. (check-in: [41c27bc0] user: drh branch: trunk, size: 187317)
2017-04-15
15:47
[d22a2ae7] part of check-in [2d0c458e] Merge latest trunk changes into this branch. (check-in: [2d0c458e] user: dan branch: schemalint, size: 188459)
14:30
[4b0d7b66] part of check-in [d238694c] Add header comment for sqlite3_vtab_collation(). (check-in: [d238694c] user: dan branch: schemalint, size: 187252)
14:16
[7b4d39ff] part of check-in [0cd75a87] Fix memory leaks in the code on this branch. Make use of the sqlite3_index_constraint.usage field. Do not try to handle ORDER BY terms with explicit COLLATE clauses - they don't get passed to the vtab layer anyway. (check-in: [0cd75a87] user: dan branch: schemalint, size: 186798)
2017-04-14
22:41
[10ae856a] part of check-in [e50fd489] Fix to the decision logic for when to use the skip-ahead-distinct optimization. (check-in: [e50fd489] user: drh branch: skip-ahead-distinct, size: 187233)
19:41
[64f2c18c] part of check-in [3bb65850] Modify the code in ext/expert/ to use the vtab interface instead of sqlite3_whereinfo_hook(). Remove sqlite3_whereinfo_hook(). (check-in: [3bb65850] user: dan branch: schemalint, size: 187129)
19:03
[e02cbd8a] part of check-in [3a5860d8] Add the TK_IF_NULL_ROW opcode to deal with non-NULL result columns in the result set of a view or subquery on the RHS of a LEFT JOIN that gets flattened. (check-in: [3a5860d8] user: drh branch: left-join-view, size: 186110)
00:45
[98388bf4] part of check-in [1aa0ea8d] Fix a couple of unreachable branches. (check-in: [1aa0ea8d] user: drh branch: skip-ahead-distinct, size: 187221)
2017-04-13
21:29
[911bf344] part of check-in [ce1e2b88] Fix the skip-ahead-distinct optimization so that it works with indexes that have repeated columns with different collating sequences. (check-in: [ce1e2b88] user: drh branch: skip-ahead-distinct, size: 187305)
19:48
[2b88a9ab] part of check-in [57c5173b] Simplification of the skip-ahead-distinct logic. There is still an issue with handling COLLATE. (check-in: [57c5173b] user: drh branch: skip-ahead-distinct, size: 188553)
18:33
[b08b998b] part of check-in [70ac9ea1] New test cases and minor fixes for the optimization on this branch. (check-in: [70ac9ea1] user: dan branch: skip-ahead-distinct, size: 188621)
13:01
[56111492] part of check-in [0cf16dec] Only use the skip-ahead-distinct optimization if the index has been analyzed and we know that a skip-head is likely to skip over at least 11 rows. The magic number 11 was determined by experimentation. (check-in: [0cf16dec] user: drh branch: skip-ahead-distinct, size: 188117)
01:19
[33fd1fcd] part of check-in [132339a1] Forward port the skip-ahead-distinct branch which was abandoned for some reason that I do not recall. This port should have been achived by a merge of trunk into the previous head of skip-ahead-distinct, but that did not work. So I had to manually "rebase" the changes. (check-in: [132339a1] user: drh branch: skip-ahead-distinct, size: 187873)
2017-04-11
19:00
[f5acfb6f] part of check-in [0f66a093] Update this branch with latest trunk changes. (check-in: [0f66a093] user: dan branch: schemalint, size: 191665)
2017-04-08
19:00
[613b1cac] part of check-in [e051e8f2] Merge latest trunk with this branch. (check-in: [e051e8f2] user: dan branch: schemalint, size: 191638)
2017-04-07
19:41
[1d14e18f] part of check-in [a52ef2ad] Proof of concept for the ability to use the expression columns in an index on expressions in place of equivalent expressions in the result set or in the WHERE clause. This check-in compiles but is mostly untested. (check-in: [a52ef2ad] user: drh branch: covering-index-on-expr, size: 186026)
2017-04-05
12:39
[49b48b72] part of check-in [ad90e8bb] Split off sqlite3DbFreeNN() from sqlite3DbFree() and use it in cases where we know that the argument to be freed is never NULL. (check-in: [ad90e8bb] user: drh branch: trunk, size: 185999)
2017-04-04
17:50
[be352441] part of check-in [5cd07000] Add some support for OR terms to sqlite3_whereinfo_hook(). (check-in: [5cd07000] user: dan branch: schemalint, size: 191544)
04:23
[cbd1e856] part of check-in [a54aef35] Add the sqlite3_whereinfo_hook() API - an experimental API replacing the DBCONFIG_WHEREINFO hack on this branch. (check-in: [a54aef35] user: dan branch: schemalint, size: 188691)
2017-04-03
14:07
[aed99e51] part of check-in [5c11f430] Avoid an unnecessary call to sqlite3WhereGetMask() inside of whereShortCut(). (check-in: [5c11f430] user: drh branch: trunk, size: 185983)
2017-03-31
11:20
[30c790ab] part of check-in [cb721d0b] Merge latest trunk into this branch. (check-in: [cb721d0b] user: dan branch: schemalint, size: 189272)
2017-03-11
13:02
[e815093e] part of check-in [3299a261] Make sure the translateColumnToCopy() routine in the query planner does not try to access an array that failed to be fully allocated due to a prior OOM. This fixes an issue discovered by OSSFuzz. (check-in: [3299a261] user: drh branch: trunk, size: 185905)
2017-02-17
21:23
[a7a99b84] part of check-in [38298ef9] Increase the estimated cost of sorting when sorting wide results sets, to account for the extra storage space and I/O required for the external sort. (check-in: [38298ef9] user: drh branch: apple-increased-sorting-cost, size: 186244)
15:26
[1a3a8adb] part of check-in [fb2b8ae8] Set the TF_StatsUsed flag on tables when the query planner outcome is affected by the sqlite_stat1 data. Also, change the column names of the "PRAGMA stats" command so that they are not keywords. (check-in: [fb2b8ae8] user: drh branch: auto-analyze, size: 185758)
2017-02-16
21:29
[69eb9080] part of check-in [aa0703e5] Increase the estimated cost of sorting when sorting wide results sets, to account for the extra storage space and I/O required for the external sort. (check-in: [aa0703e5] user: drh branch: increased-sorting-cost, size: 185546)
20:52
[01baf58b] part of check-in [9fc5cd50] Change the name of WhereInfo.pDistinctSet to pResultSet, since it is now used for more than just DISTINCT processing. (check-in: [9fc5cd50] user: drh branch: trunk, size: 185226)
2017-02-11
14:59
[6397fab5] part of check-in [e464b919] Fix indexes on expressions so that they can be actually used with a COLLATE clause. (check-in: [e464b919] user: drh branch: trunk, size: 185252)
13:51
[b0d81c6f] part of check-in [9689d04b] Ensure that indexed expressions with collating sequences are handled correctly. Proposed fix for ticket [eb703ba7b50c1a5]. (check-in: [9689d04b] user: drh branch: trunk, size: 185208)
2017-01-10
20:04
[bc71775e] part of check-in [46db23cc] Changes to allow some multi-row UPDATE statements to avoid the two-pass approach. (check-in: [46db23cc] user: dan branch: onepass-update, size: 185166)
2016-11-22
01:26
[6bbf9284] part of check-in [32be7aae] Remove unnecessary OP_Close opcodes for a size reduction and performance increase. (check-in: [32be7aae] user: drh branch: trunk, size: 185131)
2016-10-26
18:41
[952f76e7] part of check-in [c23f5ef3] Small size reduction and performance enhancement in whereScanInit(). (check-in: [c23f5ef3] user: drh branch: trunk, size: 185918)
17:57
[694dd84a] part of check-in [d861ee17] Small size reduction and performance improvement in whereScanNext(). (check-in: [d861ee17] user: drh branch: trunk, size: 185970)
15:46
[125af074] part of check-in [e7b9bc67] If all branches of an OR optimize scan that is the rhs of a LEFT JOIN use the same index, set the index cursor to return NULL values if there are no matches for a row on the lhs. (check-in: [e7b9bc67] user: dan branch: leftjoin-or-fix, size: 185872)
2016-10-12
18:55
[5f846d94] part of check-in [443913d5] Avoid reading the -1-th element of an array in the query planner. Fix to a bug introduced by check-in [8e2b25f9b8a7] from earlier today. Curiously, the problem only appeared on 32-bit systems. (check-in: [443913d5] user: drh branch: trunk, size: 185835)
15:15
[7e454887] part of check-in [61f05269] New testcase() macros to ensure coverage of the ORDER BY LIMIT optimization code in where.c. (check-in: [61f05269] user: drh branch: trunk, size: 185789)
14:48
[1398bc49] part of check-in [8e2b25f9] Fix a problem affecting queries that match the pattern (... WHERE ipk IN (....) ORDER BY ? LIMIT ?). Fix for [96c1454c]. (check-in: [8e2b25f9] user: dan branch: trunk, size: 185697)
2016-10-10
14:34
[43b53ef3] part of check-in [aebe429e] When handling ORDER BY expressions, do not assume all values of an indexed expressions are distinct. Fix for [4766f444]. (check-in: [aebe429e] user: dan branch: trunk, size: 185576)
2016-10-08
11:55
[a2269d2d] part of check-in [cbed3d75] Add missing "static" to internal function whereRangeVectorLen(). (check-in: [cbed3d75] user: dan branch: trunk, size: 185568)
2016-10-03
14:44
[c264ec85] part of check-in [5bb7cde0] Avoid unnecessary memset() calls in the query optimizer. (check-in: [5bb7cde0] user: drh branch: trunk, size: 185561)
2016-09-23
18:06
[8cb63bd4] part of check-in [0c3cafb7] Fix the ORDER BY LIMIT optimization backport so that it works when the ORDER BY uses the DESC direction. (check-in: [0c3cafb7] user: drh branch: branch-3.8.9, size: 266774)
2016-09-22
18:53
[5f91be9f] part of check-in [c3774c6a] Remove the internal sqlite3CodeOnce() interface, replacing it with a direct call to sqlite3VdbeAddOp0(v,OP_Once). Slightly smaller and faster. (check-in: [c3774c6a] user: drh branch: trunk, size: 185391)
2016-09-19
11:00
[e4140408] part of check-in [2401ea5a] Fix a segfault introduced by the row-value enhancement that comes up on a skip-scan where the first term of the index is unconstrained and the second term is of the form "columm IN (SELECT...)". (check-in: [2401ea5a] user: drh branch: trunk, size: 185385)
2016-09-16
14:50
[d0ca1b5e] part of check-in [e7653dec] Add WHERETRACE macros showing every entry and exit from whereLoopAddBtreeIndex(). (check-in: [e7653dec] user: drh branch: trunk, size: 185366)
2016-09-14
01:43
[3028fd1c] part of check-in [db361482] Backport the ORDER BY LIMIT optimization to version 3.8.9. (check-in: [db361482] user: drh branch: branch-3.8.9, size: 266810)
2016-09-07
13:12
[edbd73a8] part of check-in [193f036c] Merge fixes from trunk. (check-in: [193f036c] user: drh branch: rowvalue, size: 185138)
01:51
[4bbc3f1d] part of check-in [820644b8] The ORDER BY LIMIT optimization is not valid unless the inner-most IN operator loop is actually used by the query plan. Fix for ticket [0c4df46116e90f92]. (check-in: [820644b8] user: drh branch: trunk, size: 179708)
2016-08-26
18:17
[48d705e5] part of check-in [87d40195] Fix a post-OOM crash in updateRangeAffinityStr(). Add several ALWAYS() macros on unreachable branches. (check-in: [87d40195] user: drh branch: rowvalue, size: 184765)
13:19
[bad93f9b] part of check-in [b0cc6be4] Allow ROWID values in indexed vector comparisons. (check-in: [b0cc6be4] user: drh branch: rowvalue, size: 184724)
03:42
[2f60a506] part of check-in [39761700] Comment improvements. Put ALWAYS and NEVER macros on three unreachable branches. (check-in: [39761700] user: drh branch: rowvalue, size: 184718)
2016-08-19
18:40
[c7cdfd54] part of check-in [931c9535] Show the WhereTerm.iField value on debugging output, when it is non-zero. (check-in: [931c9535] user: drh branch: rowvalue, size: 184174)
2016-08-11
12:01
[5bee250c] part of check-in [8278be06] Fix some problems with handling "no such collation sequence" errors. (check-in: [8278be06] user: dan branch: rowvalue, size: 184045)
2016-08-08
20:15
[457a2c8c] part of check-in [156a41f3] Fix some cases involving row values and virtual tables. (check-in: [156a41f3] user: dan branch: rowvalue, size: 184033)
16:52
[f60310d9] part of check-in [0e927a7e] Merge trunk changes with this branch. (check-in: [0e927a7e] user: dan branch: rowvalue, size: 183461)
2016-08-04
09:09
[5c9df42d] part of check-in [13e3bd3d] Make sure the ORDER BY LIMIT optimization is not applied if the inner-most loop can only have a single iteration and is hence not really a loop. (check-in: [13e3bd3d] user: drh branch: trunk, size: 179335)
2016-08-03
18:00
[0a0b8af3] part of check-in [3c2f908f] Fix a problem with estimating the number of rows visited by a query that uses a multi-column IN(SELECT...) constraint. (check-in: [3c2f908f] user: dan branch: rowvalue, size: 183407)
16:39
[8bd54861] part of check-in [1559f4c4] Fix another problem involving vector range constraints and mixed ASC/DESC indexes. (check-in: [1559f4c4] user: dan branch: rowvalue, size: 182904)
16:14
[21095414] part of check-in [18af74ab] Fix stat4-based cost estimates for vector range constraints. (check-in: [18af74ab] user: dan branch: rowvalue, size: 182898)
2016-08-02
17:07
[25eae2e0] part of check-in [e2ad30c8] Fix a problem with vector range constraints and mixed ASC/DESC indexes. (check-in: [e2ad30c8] user: dan branch: rowvalue, size: 182884)
16:24
[9dcbc1be] part of check-in [d468101b] Merge latest trunk changes into this branch. (check-in: [d468101b] user: dan branch: rowvalue, size: 182721)
2016-08-01
20:14
[a1c2fde6] part of check-in [3ef75d45] Fix a problem with vector range constraints involving the rowid column. And other issues. (check-in: [3ef75d45] user: dan branch: rowvalue, size: 182718)
2016-07-30
18:54
[bb1444f6] part of check-in [390a38a1] Fix harmless compiler warning seen with MSVC. (check-in: [390a38a1] user: mistachkin branch: trunk, size: 179281)
17:59
[61db3a40] part of check-in [63ae02d0] Merge latest trunk with this branch. (check-in: [63ae02d0] user: dan branch: rowvalue, size: 182364)
2016-07-29
01:32
[fcaa38d1] part of check-in [c7d51934] Undo some unhelpful changes to skip-scan scoring that were added by the check-in [9e2b2681] that improved scoring of index scan. (check-in: [c7d51934] user: drh branch: trunk, size: 179278)
2016-07-28
13:59
[df58d6ad] part of check-in [9685880f] Merge latest trunk changes into this branch. (check-in: [9685880f] user: dan branch: rowvalue, size: 182366)
2016-07-27
19:33
[0b370db8] part of check-in [719a3b20] Fix some problems with multi-column IN(SELECT...) processing. (check-in: [719a3b20] user: dan branch: rowvalue, size: 181430)
19:30
[8ccc01f9] part of check-in [9e2b2681] Enhance the query planner cost estimation for index scans to take into account WHERE clause terms that can be computed using only the index and that do not require looking up rows in the original table. This fixes an obscure performance regression that arose when the ORDER BY LIMIT optimization was added by check-in [bf46179d44843]. (check-in: [9e2b2681] user: drh branch: trunk, size: 179280)
19:20
[66a29031] part of check-in [50f8ea37] Add test cases and fix a comment. (check-in: [50f8ea37] user: drh branch: improved-index-scan, size: 179276)
18:27
[7e4d676b] part of check-in [a59b5622] When estimating the cost of an index scan, factor in the cost savings of being able to use the index to evaluate some WHERE clause terms without having to do a table lookup. (check-in: [a59b5622] user: drh branch: improved-index-scan, size: 179274)
16:03
[9981707a] part of check-in [4d59df02] Initialize a variable in where.c to avoid a valgrind warning. (check-in: [4d59df02] user: dan branch: trunk, size: 178344)
2016-07-26
18:06
[e7054b2c] part of check-in [061b8006] Fix where.c handling of "IN (SELECT ...)" expressions when the SELECT returns more than one result column. Also error handling for other row value constructor cases. (check-in: [061b8006] user: dan branch: rowvalue, size: 180619)
2016-07-09
20:23
[898a4596] part of check-in [b2204215] Add some support for using row value constructors in certain parts of SQL expressions. There are many bugs on this branch. (check-in: [b2204215] user: dan branch: rowvalue, size: 180561)
2016-06-26
04:06
[48eed8eb] part of check-in [f8105085] Prevent the WhereLoop.rSetup cost estimate from going negative on complex queries. (check-in: [f8105085] user: drh branch: trunk, size: 178340)
2016-06-23
12:35
[0ce47934] part of check-in [91113142] Fix the build for -DSQLITE_OMIT_VIRTUALTABLE (check-in: [91113142] user: drh branch: trunk, size: 178293)
2016-06-08
18:07
[74f07985] part of check-in [fe187432] Prefer to use partial indexes for full table scans when that is possible. (check-in: [fe187432] user: drh branch: trunk, size: 178217)
2016-05-27
12:30
[b9f5b0dd] part of check-in [71087c12] Improvements to WHERE-clause debug tracing. Show TK_MATCH expressions and show more details on WhereTerm traces. (check-in: [71087c12] user: drh branch: trunk, size: 178182)
2016-05-19
22:40
[0e54a03d] part of check-in [990fe50c] Appears to work now. Needs test cases, more comments, and code optimization. (check-in: [990fe50c] user: drh branch: orderby-limit, size: 177646)
22:13
[a7454e62] part of check-in [852d1eda] In a query with both ORDER BY and LIMIT, if the inner loop satisfies the ORDER BY then try to cut short each invocation of the inner loop once the LIMIT has been satisfied. This check-in is a partial implementation only. (check-in: [852d1eda] user: drh branch: orderby-limit, size: 176988)
18:56
[72fd2e12] part of check-in [d0130584] Clean up the WHERE_* macros used for the wctrlFlags parameter on the sqlite3WhereBegin() interface, freeing up some bits to be used for other things. (check-in: [d0130584] user: drh branch: trunk, size: 176552)
2016-05-09
19:58
[ad8ad50c] part of check-in [da94a6e0] Omit the unnecessary WHERE_REOPEN_IDX flag in the WHERE interface. (check-in: [da94a6e0] user: drh branch: dev, size: 176573)
2016-05-06
18:47
[fd321cc2] part of check-in [ab7ab415] Corrections to comments on the whereScanInit() interface. (check-in: [ab7ab415] user: drh branch: trunk, size: 176609)
11:31
[a7ce00ff] part of check-in [50312273] Do not scan indexes that have the integer primary key as their left-most column. This fixes the crash of ticket [16c9801ceba] but it seems like the wrong fix. More investigation needed. (check-in: [50312273] user: drh branch: ticket-16c9801ce, size: 176425)
2016-05-02
10:25
[019e5b10] part of check-in [54c63b32] Improvements to the way the LIKE optimization is implemented, resulting in slightly smaller and faster code that is easier to test. (check-in: [54c63b32] user: drh branch: trunk, size: 176418)
2016-04-15
22:03
[de4e7665] part of check-in [87703b76] Add the SQLITE_SkipAhead optimization setting (check-in: [87703b76] user: drh branch: skip-ahead-distinct, size: 178537)
16:27
[64689b97] part of check-in [6fac0b92] Skip-ahead is now just an optimization. If it gets confused, it falls back to an incremental scan with redundancy elimination. (check-in: [6fac0b92] user: drh branch: skip-ahead-distinct, size: 178485)
15:54
[3521afa6] part of check-in [45a70b2b] Fixes to the skip-ahead distinct logic. More issues remain. (check-in: [45a70b2b] user: drh branch: skip-ahead-distinct, size: 178419)
13:24
[ded0cf90] part of check-in [2afcb2c7] Fixed crash bugs. Still sometimes gets the wrong answers. (check-in: [2afcb2c7] user: drh branch: skip-ahead-distinct, size: 177652)
01:55
[19ad1e88] part of check-in [9e14aa14] Progress toward getting DISTINCT to use a seek to advance to the next distinct row, when driven by an appropriate index. (check-in: [9e14aa14] user: drh branch: skip-ahead-distinct, size: 177559)
2016-04-14
13:35
[bae50f2f] part of check-in [53179614] Rename WhereInfo.pResultSet to pDistinctSet to more accurately reflect what it represents. (check-in: [53179614] user: drh branch: trunk, size: 176526)
2016-04-09
14:36
[24ab5614] part of check-in [3686ed74] Limit the number of digits shown in the "prereq" mask for ".wheretrace" debugging output. (check-in: [3686ed74] user: drh branch: trunk, size: 176478)
2016-03-31
21:16
[f06ac362] part of check-in [f1e6bb95] Enhance the query planner so that IS and IS NULL operators are able to drive an index on a LEFT OUTER JOIN. (check-in: [f1e6bb95] user: drh branch: branch-3.9, size: 171637)
20:40
[99cc6270] part of check-in [c648539b] Enhance the query planner so that IS and IS NULL operators are able to drive an index on a LEFT OUTER JOIN. (check-in: [c648539b] user: drh branch: trunk, size: 176426)
2016-03-16
18:26
[fe7925fa] part of check-in [96ea9909] Fix the query planner so that it is able to use the integer primary key from an index as part of a multi-column constraint. (check-in: [96ea9909] user: drh branch: trunk, size: 176154)
2016-03-15
09:42
[b8566be7] part of check-in [249cd361] Update this branch with latest trunk changes. (check-in: [249cd361] user: dan branch: schemalint, size: 179464)
2016-03-09
12:35
[5533002d] part of check-in [a13c59d0] In the query planner, make sure OOM errors are reported up into whereLoopAddVirtual() so that it shuts down appropriately. (check-in: [a13c59d0] user: drh branch: trunk, size: 176097)
08:08
[2cbcacd9] part of check-in [59caca43] Merge latest trunk changes with this branch. (check-in: [59caca43] user: dan branch: schemalint, size: 179458)
08:07
[59f267a5] part of check-in [fc18cc92] Fix a problem in the schemalint code that comes up when a sub-query uses one or more of the same tables as its parent. (check-in: [fc18cc92] user: dan branch: schemalint, size: 175189)
2016-03-08
23:44
[f2859a4f] part of check-in [73b97b9e] Change an unreachable branch in the virtual table query planner into an assert(). (check-in: [73b97b9e] user: drh branch: trunk, size: 176091)
23:18
[a3f6db08] part of check-in [4c89c253] Improved comments on virtual table query planning. Added many new WHERETRACE() macros. (check-in: [4c89c253] user: drh branch: trunk, size: 176149)
02:59
[dff52f7f] part of check-in [82ca2131] Simplified error detection in the xBestIndex processing. (check-in: [82ca2131] user: drh branch: trunk, size: 175517)
01:32
[e4d2d0ea] part of check-in [91bd619d] Add the ALLBITS macro as a shorthand for "(Bitmask)(-1)". (check-in: [91bd619d] user: drh branch: trunk, size: 175346)
01:11
[3787158e] part of check-in [721ae51e] Add a NEVER() to the code generator. Change the parameter name "mExtra" to "mPrereq" in the query planner, to more closely reflect its meaning. (check-in: [721ae51e] user: drh branch: trunk, size: 175366)
2016-03-05
21:32
[ccc62c39] part of check-in [d8d89d69] Fix a problem in the previous commit affecting queries with three or more tables joined together to the right of a LEFT or CROSS JOIN operator. (check-in: [d8d89d69] user: dan branch: trunk, size: 175335)
17:29
[bada38bf] part of check-in [ffc65968] Change the way SQLite invokes the xBestIndex method of virtual tables so that N-way joins involving virtual tables work as expected. (check-in: [ffc65968] user: dan branch: xbestindex-fix, size: 175328)
2016-03-04
18:45
[2b61974a] part of check-in [5294c977] Merge changes from trunk. (check-in: [5294c977] user: drh branch: analyze-worst-case, size: 172210)
2016-03-02
03:28
[56948ada] part of check-in [1622623c] Allow the left-hand side of IN operators on virtual tables to have the aConstraintUsage[].omit flag clear. (check-in: [1622623c] user: drh branch: vtab-IN-opt, size: 172185)
2016-03-01
22:41
[6282e53f] part of check-in [13a37fd4] Improved debugging output with wheretrace. Fix some typos in test script comments. (check-in: [13a37fd4] user: drh branch: trunk, size: 172525)
2016-02-29
21:27
[2786a5f3] part of check-in [6326ba58] The ANALYZE command automatically appends "noskipscan" to sqlite_stat1 entries that have large worst-case repeat estimates but small average repeat estimates. (check-in: [6326ba58] user: drh branch: analyze-worst-case, size: 172507)
2016-02-25
23:21
[32051597] part of check-in [2459d323] Fix an incorrect cost computation for sorting (introduced just a few check-ins ago). Should be NlogN, not NloglogN. (check-in: [2459d323] user: drh branch: trunk, size: 172482)
18:22
[b21a2b3c] part of check-in [aab53a21] Improvement on the previous check-in: disallow automatic indexes for any loop that is expected to run less than twice. (check-in: [aab53a21] user: drh branch: planner-improvements, size: 172505)
18:03
[07bf0330] part of check-in [5957e793] Do not use an automatic index on an outer loop that only runs once. (check-in: [5957e793] user: drh branch: planner-improvements, size: 172507)
16:04
[ba8f2cd9] part of check-in [d491745c] Take the LIMIT clause into account when estimating the cost of sorting. (check-in: [d491745c] user: drh branch: planner-improvements, size: 172246)
2016-02-22
19:51
[0ecce6da] part of check-in [0b734065] Add test script shell6.test, containing tests for schemalint. (check-in: [0b734065] user: dan branch: schemalint, size: 175232)
2016-02-13
23:43
[5b67fb80] part of check-in [6a9c4a3e] Enhance ability to debug out-of-memory errors. (check-in: [6a9c4a3e] user: mistachkin branch: noMemBkpt, size: 171575)
2016-02-12
00:13
[98408458] part of check-in [b5d77199] Remove an unused parameter from whereSortingCost(). (check-in: [b5d77199] user: drh branch: trunk, size: 171540)
2016-02-11
21:55
[f9683f8b] part of check-in [52571991] Remove the unexplained extra 3.0 cost factor for the B-tree sorting that is done to implement DISTINCT in the absence of an index to help. (check-in: [52571991] user: drh branch: trunk, size: 171569)
21:01
[89d58453] part of check-in [ed49f297] Experimental integration of schemalint functionality with the shell tool. Does not work yet. (check-in: [ed49f297] user: dan branch: schemalint, size: 175119)
2016-02-09
15:10
[438b89ca] part of check-in [1a4182ee] Merge latest trunk changes with this branch. (check-in: [1a4182ee] user: dan branch: schemalint, size: 176903)
2016-02-05
13:38
[d89fd5cf] part of check-in [0a802e96] Add the slightly faster sqlite3DbMallocRawNN(db,n) routine for the majority cases where db is guaranteed to be not NULL. (check-in: [0a802e96] user: drh branch: oom-handling, size: 171822)
01:55
[8bdb43e0] part of check-in [c3ef0347] Improvements to the way that OOM errors are processed. (check-in: [c3ef0347] user: drh branch: oom-handling, size: 171816)
2016-02-04
02:34
[623e4551] part of check-in [1c8d3001] Add and use the sqlite3VdbeZeroRegister() interface for coding the common operation of writing zero into a register. (check-in: [1c8d3001] user: drh branch: zero-register, size: 171808)
2016-01-26
15:23
[3e70fe90] part of check-in [12ef3a8f] Change the automatic index mechanism so that it avoids creating transient indexes on columns that are known to have low cardinality. (check-in: [12ef3a8f] user: drh branch: autoindex-planning, size: 172010)
2016-01-22
14:46
[4610f0b9] part of check-in [9341491c] Merge latest trunk changes into this branch. (check-in: [9341491c] user: dan branch: schemalint, size: 176898)
14:44
[1e987b91] part of check-in [44edc1aa] Fix handling of transitive constraints in schemalint.tcl. (check-in: [44edc1aa] user: dan branch: schemalint, size: 176819)
2016-01-21
15:55
[af9bf5dc] part of check-in [a3cec529] Improved comments on the FORDELETE hint. No logic changes. (check-in: [a3cec529] user: drh branch: trunk, size: 171817)
2016-01-11
22:58
[bb69654f] part of check-in [28bd8d5f] Performance optimization in the sqlite3VdbeChangeP4() routine of the code generator. (check-in: [28bd8d5f] user: drh branch: trunk, size: 171874)
2015-12-30
16:51
[c6d3d2f6] part of check-in [2081d757] Changes to the way that the default BINARY collating sequence is recorded result in a slightly smaller and slightly faster executable. More work could be done to make this cleaner. (check-in: [2081d757] user: drh branch: trunk, size: 171928)
2015-12-12
17:31
[b7462d37] part of check-in [21526012] Add further tests for the changes on this branch. Also fix a memory-leak that could follow a malloc failure. (check-in: [21526012] user: dan branch: onepass-delete-or, size: 174382)
2015-12-09
10:06
[b3b70c8e] part of check-in [10ca7357] Add simple tests and bugfixes for DELETE statements that qualify for the OR-optimization. (check-in: [10ca7357] user: dan branch: onepass-delete-or, size: 173735)
2015-12-08
19:50
[93f5c7ec] part of check-in [d52376df] Experimental optimization for DELETE statements with WHERE clauses that qualify for the OR-optimization. (check-in: [d52376df] user: dan branch: onepass-delete-or, size: 173763)
2015-12-01
21:23
[b18edbb9] part of check-in [9e1d6d4c] Add the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option. (check-in: [9e1d6d4c] user: drh branch: trunk, size: 171896)
2015-11-30
18:17
[be09f4a0] part of check-in [451e0faf] Fix the schemalint.tcl script to handle identifiers that require quoting. (check-in: [451e0faf] user: dan branch: schemalint, size: 176791)
2015-11-26
19:33
[9c04982b] part of check-in [116b2064] Add the "colUsed" field to the sqlite3_index_info structure passed to virtual table xBestIndex methods. To indicate the subset of the virtual table columns that may be required by the current scan. (check-in: [116b2064] user: dan branch: vtab-colused, size: 171850)
2015-11-23
21:09
[6687fb26] part of check-in [277a5b40] Add experimental support for LIKE, GLOB and REGEXP to the virtual table interface. (check-in: [277a5b40] user: dan branch: vtab-like-operator, size: 171796)
2015-11-20
20:55
[58049022] part of check-in [93bdf70e] Add support for ORDER BY clauses to schemalint.tcl. (check-in: [93bdf70e] user: dan branch: schemalint, size: 176691)
2015-11-11
18:08
[61764263] part of check-in [c6fa01c2] Add a hack to debug out a description of the WHERE clause of a SELECT (or other) statement. Use this in script tool/schemalint.tcl to automatically recommend indexes that might speed up specific queries. (check-in: [c6fa01c2] user: dan branch: schemalint, size: 175780)
2015-10-26
20:11
[6aceb72c] part of check-in [20da0849] Merge the BTREE_FORDELETE enhancement with this branch. (check-in: [20da0849] user: dan branch: cursor-hints, size: 171738)
18:51
[51cca249] part of check-in [53d5a4ad] Merge in all trunk changes prior to the BTREE_FORDELETE enhancement. (check-in: [53d5a4ad] user: drh branch: cursor-hints, size: 171482)
17:50
[0a3badc4] part of check-in [871b1c78] Provide the BTREE_FORDELETE flag to sqlite3BtreeCursor() if the cursor will be used only for deletions and seeking. (check-in: [871b1c78] user: drh branch: trunk, size: 171571)
14:54
[7b9e8d72] part of check-in [138783b5] Fix a C99-ism and a harmless compiler warning. (check-in: [138783b5] user: drh branch: trunk, size: 171365)
2015-10-24
20:31
[e3724b7b] part of check-in [bfea226d] When creating an automatic-index on a sub-query, add a unique integer to the end of each index key to ensure the entire key is unique. Fix for [8a2adec1]. (check-in: [bfea226d] user: dan branch: trunk, size: 171365)
2015-10-22
20:54
[0bb01a05] part of check-in [cdc92919] Modifications to pass a flag to internal routine sqlite3BtreeCursor() when a cursor that is used solely for deleting b-tree entries, or for obtaining the components of keys to delete from other b-trees, is opened. (check-in: [cdc92919] user: dan branch: btree-fordelete-flag, size: 170749)
2015-10-14
20:09
[05a178b7] part of check-in [29444149] Merge in all the 3.9.0 updates from trunk. (check-in: [29444149] user: drh branch: cursor-hints, size: 170660)
2015-09-29
17:20
[4c464667] part of check-in [7d272aa6] Use symbolic names XN_ROWID and XN_EXPR in place of the (-1) and (-2) magic numbers in Index.aiColumn[]. Add asserts to help verify that Index.aiColumn[] is always used correctly. Fix one place in FK processing where Index.aiColumn[] was not being used correctly. (check-in: [7d272aa6] user: drh branch: trunk, size: 170543)
11:59
[b7f928b6] part of check-in [b519c0d6] Merge latest trunk change into this branch. (check-in: [b519c0d6] user: dan branch: vtab-onepass, size: 170443)
11:57
[6491ebe8] part of check-in [f61203bc] Change the name of the new sqlite3_index_info.flags field to "idxFlags". Add documentation for the same to sqlite.h.in. (check-in: [f61203bc] user: dan branch: vtab-onepass, size: 170146)
2015-09-28
23:45
[e779853a] part of check-in [70ec88b2] Avoid unnecessary cursors and seeking when running a DELETE against a WITHOUT ROWID table. (check-in: [70ec88b2] user: drh branch: delete-without-rowid-opt, size: 170509)
17:05
[25d75272] part of check-in [c5566bb3] Extra information provided by .wheretrace on input flags to the query planner and on the result of sqlite3WhereOkOnePass(). (check-in: [c5566bb3] user: drh branch: trunk, size: 170050)
15:20
[d07fb770] part of check-in [e73f919f] Changes to allow DELETE operations on virtual tables to use the onepass strategy under some circumstances. (check-in: [e73f919f] user: dan branch: vtab-onepass, size: 170137)
14:40
[f2c4905e] part of check-in [9d057f52] Fix a database corruption bug caused by the ONEPASS optimization added in check-in [8b93cc5937000535]. Bug detected (prior to release) by sqllogictest. Test cases to follow. (check-in: [9d057f52] user: drh branch: trunk, size: 169753)
2015-09-25
01:09
[a7582b75] part of check-in [1350dd42] Fix a problem computing affinities for indexes during skip-scan code generation when SQLITE_ENABLE_STAT4 is on. Bug introduced by check-in [1ee089a72d789002]. (check-in: [1350dd42] user: drh branch: trunk, size: 169677)
2015-09-24
18:47
[278073aa] part of check-in [668fc1eb] Enhance the query planner so that it is able to use indexed expressions to help fulfill an ORDER BY clause. (check-in: [668fc1eb] user: drh branch: trunk, size: 169666)
17:38
[6f7156dc] part of check-in [1c8c5380] Fix over-length source code lines in where.c. No logic changes. (check-in: [1c8c5380] user: drh branch: trunk, size: 169220)
15:06
[edcaa18b] part of check-in [fbe63762] Merge trunk changes into the cursor-hints branch. (check-in: [fbe63762] user: drh branch: cursor-hints, size: 169344)
12:19
[d5eed258] part of check-in [c2fcb032] Make sure joins work correctly when both sides of the join are connected using indexed expressions. (check-in: [c2fcb032] user: drh branch: trunk, size: 169227)
11:26
[64a80b1c] part of check-in [d9b716a6] Correctly handle the case of a WHERE-clause term with indexed expressions on both sides of the == sign. (check-in: [d9b716a6] user: drh branch: trunk, size: 169222)
2015-09-15
17:31
[c03895cd] part of check-in [66fe0683] Merge enhancements from trunk. (check-in: [66fe0683] user: drh branch: cursor-hints, size: 169362)
2015-09-14
14:45
[882fb44b] part of check-in [16e56bda] Use symbolic names ONEPASS_OFF, ONEPASS_SINGLE, and ONEPASS_MULTI for the various modes of the one-pass optimization. (check-in: [16e56bda] user: drh branch: trunk, size: 169245)
2015-09-12
19:26
[98cbedea] part of check-in [eaeb2b80] Experimental change to use a single-pass approach for DELETE statements on non-virtual tables that do not fire triggers or require foriegn-key processing. (check-in: [eaeb2b80] user: dan branch: onepass-delete, size: 168953)
2015-09-09
17:23
[1227687e] part of check-in [280fd3a4] Fix harmless compiler warning. (check-in: [280fd3a4] user: mistachkin branch: trunk, size: 168615)
2015-09-05
19:21
[ed1cd1cb] part of check-in [24924a58] Fix an unreachable conditional in the WHERE clause analysis logic. (check-in: [24924a58] user: drh branch: trunk, size: 168611)
2015-09-03
14:39
[6055bee2] part of check-in [25ee3000] Merge enhancements from trunk. (check-in: [25ee3000] user: drh branch: cursor-hints, size: 168263)
14:18
[e6efbb9e] part of check-in [1ab10cbf] Merge enhancements from trunk. (check-in: [1ab10cbf] user: drh branch: index-expr, size: 168588)
13:46
[f0e08e4f] part of check-in [847387ec] Add the sqlite3VdbeLoadString() and sqlite3VdbeMultiLoad() routines to help with code generation, especially on PRAGMAs. Rename sqlite3VdbeAddGoto() to just sqlite3VdbeGoto(). (check-in: [847387ec] user: drh branch: trunk, size: 168146)
2015-09-02
18:19
[8f3a40cc] part of check-in [be78f413] Add the sqlite3VdbeAddGoto(v,i) routine as a shorthand for sqlite3VdbeAddOp2(v,OP_Goto,0,i). (check-in: [be78f413] user: drh branch: trunk, size: 168155)
2015-09-01
18:31
[5efdfbfa] part of check-in [29570a60] Merge enhancements from trunk. (check-in: [29570a60] user: drh branch: cursor-hints, size: 168305)
00:42
[567b96aa] part of check-in [fd4da231] Remove unreachable branches. (check-in: [fd4da231] user: drh branch: index-expr, size: 168630)
2015-08-31
19:38
[04e0f87e] part of check-in [cc60321a] Always assume that indexed expressions can generate a NULL. Get indexed expressions working for the case of two or more expressions in the same index. (check-in: [cc60321a] user: drh branch: index-expr, size: 168642)
15:58
[385f927f] part of check-in [f8893696] Improved analysis and usage of indexed expressions in the query planner. (check-in: [f8893696] user: drh branch: index-expr, size: 168633)
2015-08-27
23:42
[acec45dc] part of check-in [cf452028] Fix the OR-optimization so that it always ignores subplans that do not use an index. (check-in: [cf452028] user: drh branch: index-expr, size: 168951)
23:18
[91e73ffc] part of check-in [66f92a16] Fix the OR-optimization so that it always ignores subplans that do not use an index. (check-in: [66f92a16] user: drh branch: trunk, size: 168188)
20:33
[b22b4166] part of check-in [73d361ce] Fix EXPLAIN QUERY PLAN output for indexed-expressions. Fix another obscure fault in the WHERE term scanner. (check-in: [73d361ce] user: drh branch: index-expr, size: 168902)
19:56
[fcdded4b] part of check-in [03375017] Fix problems in the indexed-expression handling in the optimizer. (check-in: [03375017] user: drh branch: index-expr, size: 168925)
18:24
[29851b4a] part of check-in [42f93f58] Activate the ability to use expressions in indexes in a query. There are some test failures, but mostly this seems to work. (check-in: [42f93f58] user: drh branch: index-expr, size: 168830)
16:07
[7b62bfb9] part of check-in [c80e9e8e] Merge changes from trunk. (check-in: [c80e9e8e] user: drh branch: index-expr, size: 168566)
15:58
[0709bbc3] part of check-in [5611130a] Adjustments to the WHERE term scanning, to better handle scanning terms of an index. (check-in: [5611130a] user: drh branch: index-expr, size: 168697)
2015-08-26
21:08
[caabc9ec] part of check-in [cbc3c9a8] Reduce the size of the WhereScan object by 24 bytes while also clarifying its operation. (check-in: [cbc3c9a8] user: drh branch: trunk, size: 168139)
2015-08-25
19:42
[fb8546b8] part of check-in [b3732a4e] Move sqlite3IndexColumnAffinity() inside of SQLITE_ENABLE_STAT3_OR_STAT4. (check-in: [b3732a4e] user: drh branch: trunk, size: 168270)
19:20
[30091fb3] part of check-in [1ee089a7] Use the sqlite3IndexColumnAffinity() routine to quickly and correctly find the affinity of an index column. (check-in: [1ee089a7] user: drh branch: trunk, size: 167955)
2015-08-20
23:45
[746317b8] part of check-in [b9927c87] Merge recent enhancements from trunk, including table-valued expressions. (check-in: [b9927c87] user: drh branch: cursor-hints, size: 168112)
2015-08-19
17:11
[66518a14] part of check-in [40e12cfe] A list of arguments following a table name translates into equality constraints against hidden columns in that table. (check-in: [40e12cfe] user: drh branch: table-valued-functions, size: 167995)
15:20
[a572b239] part of check-in [b9193761] Minor refactor of the SrcList object so that it is able to hold the argument list to a table-valued-function in the FROM clause. (check-in: [b9193761] user: drh branch: table-valued-functions, size: 167926)
2015-08-14
18:50
[ef95e56b] part of check-in [581e3d49] Fix the cursor hint mechanism so that it does the right thing for indexed lookups. (check-in: [581e3d49] user: drh branch: cursor-hints, size: 167985)
2015-08-07
20:57
[c745d3aa] part of check-in [06576590] Enhance the query planner so that it is able to use partial indexes that use AND-connected terms in the WHERE clause. (check-in: [06576590] user: drh branch: trunk, size: 167868)
2015-06-12
12:54
[909eba3b] part of check-in [711a176c] Add the OP_ColumnsUsed opcode (when compiled with SQLITE_ENABLE_COLUMN_USED_MASK) as a hint to the b-tree layer as to which columns of a btree cursor will be used. (check-in: [711a176c] user: drh branch: trunk, size: 167735)
2015-06-10
20:00
[aa26f4b0] part of check-in [0e23a079] Merge enhancements from trunk. (check-in: [0e23a079] user: drh branch: view-optimization, size: 167592)
17:20
[6a42bd33] part of check-in [a1eaf171] Resolve FROM-clause subqueries after query planning instead of before. Greatly reduce the estimated cost of automatic indexes for VIEWs and ephemeral tables since performance problems there cannot be mitigated via a CREATE INDEX. (check-in: [a1eaf171] user: drh branch: view-optimization, size: 165675)
2015-06-09
10:58
[95c0fbff] part of check-in [a34cd71c] Remove some repeated lines of source code. Probably introduced by careless cut'n'pasting. (check-in: [a34cd71c] user: dan branch: vtab-left-join, size: 166996)
2015-06-08
22:59
[fbd93e76] part of check-in [cabf2187] Code refactoring to try to shift FROM-clause subquery manifesting until after the query planner runs. Except this does not currently work because the query planner needs an estimated of the number of rows in the manifested table. Work in progress. (check-in: [cabf2187] user: drh branch: view-optimization, size: 165589)
18:48
[d98dd946] part of check-in [0d9edfab] If a query contains "FROM t1 LEFT JOIN t2, t3, t4", ensure that tables t3 and t4 are not scanned before t2. The trunk already does this. (check-in: [0d9edfab] user: dan branch: vtab-left-join, size: 167045)
18:05
[38b2c4be] part of check-in [80ee56dd] Avoid passing constraints that are unusable due to LEFT or CROSS joins to virtual table xBestIndex() methods. (check-in: [80ee56dd] user: dan branch: vtab-left-join, size: 166968)
14:23
[a328fcc3] part of check-in [46ef95c1] Split more subfunctions of where.c out into a new whereexpr.c source file, for improved maintainability. (check-in: [46ef95c1] user: drh branch: view-optimization, size: 165079)
2015-06-06
20:12
[c9d804dc] part of check-in [faa0e420] Split out the bulk of the actual VDBE code generation logic from where.c into a new file, leaving behind the analysis logic. This makes the original where.c smaller and hopefully easier to edit. (check-in: [faa0e420] user: drh branch: view-optimization, size: 209992)
18:30
[5cc416ad] part of check-in [4f20ac90] Code simplifications in select.c and where.c. (check-in: [4f20ac90] user: drh branch: view-optimization, size: 269275)
2015-06-05
15:59
[f957a398] part of check-in [f167bba4] Add a new opcode to the VDBE that gives the b-tree a hint about the set of columns in a table or index that are actually used by the query. (check-in: [f167bba4] user: drh branch: column-usage-hint, size: 270109)
2015-06-04
12:08
[2db8137f] part of check-in [6a9cf063] Change the name of SrcList.a[].zIndex to the more descriptive SrcList.a[0].zIndexedBy. (check-in: [6a9cf063] user: drh branch: trunk, size: 269370)
2015-06-02
15:32
[dcdfee81] part of check-in [bce3f041] Rename SQLITE_AFF_NONE to SQLITE_AFF_BLOB. (check-in: [bce3f041] user: drh branch: blob-affinity-rename, size: 269366)
2015-05-29
14:36
[f6f41c2f] part of check-in [6d410442] Add some extra source-code comments and a test case. (check-in: [6d410442] user: drh branch: coroutine-autoindex, size: 269353)
13:55
[5eb9ab47] part of check-in [521345ad] An attempt to allow automatic index creation on subqueries accessed via co-routine. (check-in: [521345ad] user: drh branch: coroutine-autoindex, size: 269106)
2015-05-20
19:34
[96ff2c97] part of check-in [fc1a4f29] Fix a problem causing collation sequence names to be dequoted multiple times under some circumstances. Cherrypick of [eddc05e7bb31]. (check-in: [fc1a4f29] user: dan branch: branch-3.8.6, size: 245252)
2015-05-18
12:18
[e71eae3b] part of check-in [204e567f] Use an ALWAY() on conditionals in the transitive constraint logic that are always true as far as we know. (check-in: [204e567f] user: drh branch: transitive-constraints, size: 267863)
11:34
[68369923] part of check-in [6bfaf525] Refinements to the determination of when an A==B term is an equivalence. Add test cases. (check-in: [6bfaf525] user: drh branch: transitive-constraints, size: 267744)
2015-05-16
20:51
[ca8d3b5b] part of check-in [8c886c43] Further restrictions on the use of the transitive property in WHERE clauses. (check-in: [8c886c43] user: drh branch: transitive-constraints, size: 267558)
19:17
[58c0161b] part of check-in [a46a247f] Fix the transitive constraint processing to only allow transitivity if the operands of the == or IS operator have compatible affinities. (check-in: [a46a247f] user: drh branch: transitive-constraints, size: 266903)
18:31
[430ae75d] part of check-in [ee4b7425] Fix a typo in a comment. No changes to code. (check-in: [ee4b7425] user: drh branch: trunk, size: 266154)
2015-05-15
20:14
[8b319f2a] part of check-in [1a4628c6] Minor coding style change, adjust new local variable casing for consistency. (check-in: [1a4628c6] user: mistachkin branch: trunk, size: 266157)
19:59
[78dd9fc7] part of check-in [e038ce89] Do not assume that "col IS ?" matches at most a single row of a UNIQUE column unless the column is also NOT NULL. (check-in: [e038ce89] user: dan branch: trunk, size: 266157)
2015-05-14
13:41
[08fadd0d] part of check-in [b3676377] More test cases. Remove some invalid testcase() macros. Rearrange some code for improved testability. (check-in: [b3676377] user: drh branch: index-is-operator, size: 266087)
13:18
[cabecc4a] part of check-in [d195d4a6] Add testcase() macros. Get transitive WHERE clause constraints on IS operators working again. (check-in: [d195d4a6] user: drh branch: index-is-operator, size: 266181)
08:58
[f6c34b6a] part of check-in [299ed55c] Merge latest trunk changes with this branch. (check-in: [299ed55c] user: dan branch: ota-update, size: 265766)
01:05
[64afb483] part of check-in [4541688b] A new implementation of indexing with the IS operator that works correctly when the IS operator is in the WHERE clause and the operands are from opposite sides of a LEFT JOIN. (check-in: [4541688b] user: drh branch: index-is-operator, size: 266040)
2015-05-13
19:33
[fa61aca1] part of check-in [95b1f9bf] Simplified implementation of indexing with the IS operator. (check-in: [95b1f9bf] user: drh branch: index-is-operator, size: 265788)
17:54
[98964edb] part of check-in [24263d08] Add testcase() macros and comments and a few test-cases. (check-in: [24263d08] user: drh branch: index-is-operator, size: 265992)
15:24
[48e3c1f0] part of check-in [6f7f1673] An early attempt to get indexes to work with the IS operator. This code passes tests, but much more testing is needed to verify that it works on all corner cases. (check-in: [6f7f1673] user: drh branch: index-is-operator, size: 265472)
2015-05-02
11:45
[85fff9c4] part of check-in [7952c322] Cleanup of the sqlite3StrAccumInit() function. No functionality changes. (check-in: [7952c322] user: drh branch: trunk, size: 265384)
2015-04-25
12:20
[52c524b8] part of check-in [08ec9f2f] Fix an obscure memory leak that could follow an OOM in where.c. (check-in: [08ec9f2f] user: dan branch: trunk, size: 265397)
2015-04-23
19:32
[80998bcd] part of check-in [1506e99e] Merge latest trunk changes into this branch. (check-in: [1506e99e] user: dan branch: ota-update, size: 265600)
2015-04-22
14:41
[ba0839e7] part of check-in [658e20f5] Prototype for an sqlite3_db_log() interface. (check-in: [658e20f5] user: drh branch: sqlite3_db_log, size: 265233)
2015-04-21
02:12
[32fe265e] part of check-in [588db14f] Make sure the whereSplit() routine in the query planner is not confused by the likely() operator. (check-in: [588db14f] user: drh branch: trunk, size: 265218)
2015-04-19
23:48
[723b4f61] part of check-in [5ae853aa] Fix another harmless compiler warning. (check-in: [5ae853aa] user: mistachkin branch: vsix2015, size: 265181)
2015-04-15
14:26
[7e5d9a56] part of check-in [9bd3e445] Merge all recent trunk enhancements and fixes into the ota-update branch. (check-in: [9bd3e445] user: drh branch: ota-update, size: 265575)
07:34
[8ba8ff31] part of check-in [eeb4bd06] Remove an incorrect ALWAYS() from the automatic index generator. (check-in: [eeb4bd06] user: drh branch: trunk, size: 265193)
05:31
[8a05434f] part of check-in [a0b6e2fe] Correctly deal with an unknown collating sequence on an indexed DISTINCT query. (check-in: [a0b6e2fe] user: drh branch: trunk, size: 265201)
2015-04-12
01:22
[9952e474] part of check-in [e527d96a] Avoid problems when a query has a GROUP BY and an ORDER BY but no FROM clause. (check-in: [e527d96a] user: drh branch: trunk, size: 265209)
2015-04-11
11:44
[bd435b75] part of check-in [e3b1f625] Do not assume an index contains unique entries unless it is declared UNIQUE and NOT NULL is specified for all columns. Fix for [7b4fee9f6c]. (check-in: [e3b1f625] user: dan branch: trunk, size: 265198)
2015-03-25
15:23
[bc7276b6] part of check-in [4e8796af] Extend [52e73eec] so that the IS optimization may be used on primary keys with more than 3 columns. (check-in: [4e8796af] user: dan branch: ota-update, size: 265580)
2015-03-24
18:21
[d336e918] part of check-in [9d9b6c88] Merge the latest trunk changes into this branch. (check-in: [9d9b6c88] user: dan branch: ota-update, size: 265390)
2015-03-20
14:57
[85d832ef] part of check-in [e750830f] Provide the BTREE_SEEK_EQ hint to the b-tree layer. (check-in: [e750830f] user: drh branch: seek-eq, size: 265198)
08:43
[6dc10d18] part of check-in [eddc05e7] Fix a problem causing collation sequence names to be dequoted multiple times under some circumstances. (check-in: [eddc05e7] user: dan branch: trunk, size: 264932)
2015-03-18
20:03
[67c11509] part of check-in [52e73eec] Allow whereShortCut() to use the PRIMARY KEY index of a WITHOUT ROWID table to optimize a vector of "IS" operators in a WHERE clause. (check-in: [52e73eec] user: dan branch: ota-update, size: 257754)
2015-03-16
20:40
[42ce3fd5] part of check-in [ab832336] Make SQLite slightly more likely to use an auto-index within a sub-query. (check-in: [ab832336] user: dan branch: trunk, size: 264949)
17:48
[5ca2899f] part of check-in [8bdda827] When the WHERE clause contains two OR-connected terms with identical operands but different operators, try to combine them into a single term. Example: (X=A OR X>A) becomes (X>=A). (check-in: [8bdda827] user: drh branch: trunk, size: 264949)
13:12
[235b1f50] part of check-in [23f71a26] Improved comments. No code changes. (check-in: [23f71a26] user: drh branch: combine-disjuncts, size: 260926)
12:13
[b879a02e] part of check-in [7a309768] When a WHERE clause contains disjuncts with the same operands, try to combine them into a single operator. Example: (x=A OR x>A) becomes (x>=A). (check-in: [7a309768] user: drh branch: combine-disjuncts, size: 260779)
2015-03-14
18:59
[5a4e4ab3] part of check-in [e1caf93c] When estimating the number of rows visited by a range scan for which the keys consist of more than one field, consider prefixes of stat4 samples as well as the full samples. (check-in: [e1caf93c] user: dan branch: stat4-change, size: 261585)
2015-03-09
13:01
[eb141b07] part of check-in [984c3fd5] Fix the LIKE optimization so that it works even if there are additional range contraints on the column that is subject to the LIKE or GLOB. (check-in: [984c3fd5] user: drh branch: trunk, size: 257562)
12:11
[21c96bc0] part of check-in [0e02dc94] Always use LIKE optimization range constraints in pairs. (check-in: [0e02dc94] user: drh branch: like-opt-fix, size: 257323)
2015-03-07
20:32
[65813699] part of check-in [465bfc72] Fix another problem with the LIKE optimization. (check-in: [465bfc72] user: drh branch: like-opt-fix, size: 256480)
03:02
[84104123] part of check-in [55ff4291] Remove some code that is commented out. (check-in: [55ff4291] user: drh branch: like-opt-fix, size: 256230)
02:51
[efa0cef9] part of check-in [564b8fe7] Fix problems with reverse order sorting and indexes in the LIKE optimization. (check-in: [564b8fe7] user: drh branch: like-opt-fix, size: 256342)
00:57
[7c646a15] part of check-in [26cb5145] Refactor some jump opcodes in the VDBE. Add JumpZeroIncr and DecrJumpZero. Fix the LIKE optimization to work with DESC sort order. (check-in: [26cb5145] user: drh branch: like-opt-fix, size: 256067)
2015-03-06
20:49
[8cd4fc29] part of check-in [6b993bd5] Test cases added. Comments fixed. Proposed solution for ticket [05f43be8fdda9fbd9]. (check-in: [6b993bd5] user: drh branch: like-opt-fix, size: 255673)
19:47
[cace7eef] part of check-in [a58aafdb] Fix the LIKE optimization even when comparing mixed-case BLOBs. (check-in: [a58aafdb] user: drh branch: like-opt-fix, size: 255099)
16:45
[b7e82341] part of check-in [5757e803] The LIKE optimization must be applied twice, once for strings and a second time for BLOBs. Ticket [05f43be8fdda9f]. This check-in is a proof-of-concept of how that might be done. (check-in: [5757e803] user: drh branch: like-opt-fix, size: 253753)
2015-03-02
17:25
[c1b37069] part of check-in [17890292] Ensure that automatic indexes are *not* considered when doing the the subqueries of the OR-optimization. (check-in: [17890292] user: drh branch: trunk, size: 252160)
2015-02-25
00:24
[a50d5082] part of check-in [3af300bf] Remove an always-false conditional from constructAutomaticIndex(). Put an assert() in its place to prove that the conditional is always false. (check-in: [3af300bf] user: drh branch: trunk, size: 252072)
2015-02-24
20:10
[294423cf] part of check-in [1d6fb43a] Prevent partial indexes on the table on the left hand side of a LEFT JOIN from being incorrectly qualified by a constraint in the ON clause of the join. This relaxes the rule introduced by the previous commit (as the partial indexes on the table on the rhs of the LEFT JOIN may now be qualified by terms within the ON clause). (check-in: [1d6fb43a] user: dan branch: trunk, size: 251874)
16:48
[88509f19] part of check-in [1a1516e4] This additional fix prevents a partial index from being qualified for use if the constraint that qualifies the partial index is part of the ON clause of a LEFT JOIN. (check-in: [1a1516e4] user: drh branch: tkt-2326c258, size: 251765)
16:05
[59ab7da7] part of check-in [c0f4e308] Make sure partial automatic indexes are not based on terms in the ON clause of a LEFT JOIN. Fix for ticket [2326c258d02ead3]. UPDATE: This fix does not work where the partial index is a named index. (check-in: [c0f4e308] user: drh branch: tkt-2326c258, size: 251696)
2014-12-12
00:20
[d46de821] part of check-in [b7489f94] Fix a bug in the threadtest4.c program. Remove the keyinfo cache as it provides minimal performance improvements, and then only at SQL preparation time, not at runtime, and it has problems with data races in shared-cache mode. We might later add the keyinfo cache back but only enable it when shared-cache mode is off. (check-in: [b7489f94] user: drh branch: threadtest4, size: 251644)
2014-12-05
21:18
[e914fdb9] part of check-in [42d44adc] Avoid a potential NULL pointer deference in the sqlite3_stmt_scanstatus() logic. (check-in: [42d44adc] user: drh branch: trunk, size: 251700)
19:50
[8877b55e] part of check-in [fdb66733] Make sure the WhereTerm objects are fully zeroed when they are allocated. (check-in: [fdb66733] user: drh branch: trunk, size: 251682)
2014-12-04
20:24
[d67fe69d] part of check-in [1461d543] Performance enhancement for single-table queries with many OR-connected WHERE clause terms and multiple indexes with the same left-most columns. (check-in: [1461d543] user: drh branch: trunk, size: 251603)
2014-11-22
19:52
[a0b16f9d] part of check-in [9660ce54] Fix an error in the comments from the previous check-in. (check-in: [9660ce54] user: drh branch: trunk, size: 251670)
18:50
[33285024] part of check-in [22165994] Deploy heuristics (well-commented) to better estimate how much unindexed terms in the WHERE clause filter the number of output rows from a single table. (check-in: [22165994] user: drh branch: trunk, size: 251667)
16:14
[46dd9b76] part of check-in [e1f893c6] Unintentional edits mistakenly checked in. Was: Remove an obsolete and incorrect comment from the whereLoopOutputAdjust() routine in the query planner. No changes to working code. (check-in: [e1f893c6] user: drh branch: mistake, size: 250186)
12:22
[13a99204] part of check-in [eea47933] Remove a redundant test case (probably a copy/paste error). Add an assert() to where.c to ensure that automatic indexes do not have there output row counts adjusted downward by supplementary constraints. (check-in: [eea47933] user: drh branch: trunk, size: 250324)
2014-11-18
21:54
[e275cb74] part of check-in [4461bf04] Adding the "noskipscan" token to an sqlite_stat1.stat field prevents an index for being used with the skip-scan algorithm. (check-in: [4461bf04] user: drh branch: trunk, size: 250272)
2014-11-15
19:08
[cb89128d] part of check-in [00fe0950] Adding the "noskipscan" token to an sqlite_stat1.stat field prevents an index for being used with the skip-scan algorithm. (check-in: [00fe0950] user: drh branch: noskipscan-token, size: 250216)
2014-11-14
19:34
[4d72a350] part of check-in [93642a65] Consider using an automatic-index for a scan even if there exists a possible skip-scan that uses one or more "=" operators. (check-in: [93642a65] user: dan branch: experimental-autoindex-fix, size: 250244)
2014-11-06
03:55
[3862a117] part of check-in [f9684000] Change the SQLITE_SCANSTAT_EST parameter so that it returns a double for the estimated number of output rows per loop, rather than a 64-bit integer. Revise the output format for the ".scanstats on" in the shell to make use of this new capability. (check-in: [f9684000] user: drh branch: scanstatus, size: 250188)
2014-11-05
19:26
[2c2081c5] part of check-in [2d36be5d] Change the query planner to do a better job of estimating the number rows selected by a BETWEEN operator using STAT4 when both upper and lower bounds are contained within the same sample. (check-in: [2d36be5d] user: drh branch: trunk, size: 250270)
13:13
[24096104] part of check-in [c106b755] Enhance whereLoopCheaperProperSubset(X,Y) so that it does not report true if X uses skip-scan less than Y, since in that case X might deserve to be cheaper even if it is a proper subset. (check-in: [c106b755] user: drh branch: trunk, size: 249504)
2014-11-03
15:33
[d5fa1081] part of check-in [a2303c71] Add further tests. Fixes so that compilation without ENABLE_STMT_SCANSTATUS works. (check-in: [a2303c71] user: dan branch: scanstatus, size: 249416)
11:25
[53dae5ed] part of check-in [f5313e0c] Remove unused variable from struct WhereInfo. Add some explanatory comments to new code. (check-in: [f5313e0c] user: dan branch: scanstatus, size: 249406)
2014-11-01
21:00
[ad4a3bca] part of check-in [f13d6ba8] Minor performance enhancements to SQLITE_ENABLE_STMT_SCANSTATUS code. (check-in: [f13d6ba8] user: dan branch: scanstatus, size: 248618)
20:38
[fb404e3d] part of check-in [9ea37422] If SQLITE_ENABLE_STMT_SCANSTATUS is defined, record the number of times each VDBE opcode is executed. Derive the values returned by sqlite3_stmt_scanstatus() from these records on demand. (check-in: [9ea37422] user: dan branch: scanstatus, size: 248569)
18:08
[636ca646] part of check-in [8d8cc960] Minor fixes and documentation improvements for sqlite3_stmt_scanstatus(). (check-in: [8d8cc960] user: dan branch: scanstatus, size: 249143)
2014-10-31
20:11
[344beac0] part of check-in [6a9bab34] Add the experimental sqlite3_stmt_scanstatus() API. (check-in: [6a9bab34] user: dan branch: scanstatus, size: 248662)
2014-10-28
15:58
[5665df88] part of check-in [23073a05] Trivial simplification to the automatic index logic. (check-in: [23073a05] user: drh branch: trunk, size: 247514)
2014-10-25
13:42
[4ce8c482] part of check-in [0f08924f] Increase the resolution of the second parameter to the likelihood() SQL function (the probability value) so that it can handle probabilities as small as 0.00000001. Formerly, it ran out of precision at 0.001. (check-in: [0f08924f] user: drh branch: trunk, size: 247591)
12:28
[3312adfd] part of check-in [b9ad601e] Do not use virtual (and hence redundant) WHERE-clause terms to restrict the content of a automatic partial index. Show when an automatic partial index is used in the EXPLAIN QUERY PLAN output. (check-in: [b9ad601e] user: drh branch: trunk, size: 247590)
2014-10-24
19:28
[cc0733c5] part of check-in [d95d0313] Enhance the automatic index logic so that it creates a partial index when doing so gives the same answer for less work. UPDATE: This change introduced a bug described by ticket [2326c258d02ead33]. (check-in: [d95d0313] user: drh branch: trunk, size: 247412)
15:26
[f5c13d9c] part of check-in [401235ed] Honor a high likelihood() on range constraints. (check-in: [401235ed] user: drh branch: trunk, size: 246671)
14:32
[746d4f22] part of check-in [03d0498d] Get the likelihood() functions working on operators like BETWEEN that create virtual terms in the WHERE-clause analysis. (check-in: [03d0498d] user: drh branch: trunk, size: 246553)
2014-10-23
17:26
[c9613a13] part of check-in [c6a5b67a] Add debugging code to count the number of iterations of each loop made as part of statement execution. (check-in: [c6a5b67a] user: dan branch: debug-loopcounters, size: 246992)
2014-10-22
19:57
[2cd9e0af] part of check-in [ca3b00c4] Change the 0x800 bit of SQLITE_TESTCTRL_OPTIMIZATIONS so that it disables the loading of STAT3 and STAT4 content, not just the using of that content. Change the internal name of that bit to SQLITE_Stat34. (check-in: [ca3b00c4] user: drh branch: trunk, size: 246397)
15:27
[5099c42e] part of check-in [3c933bf9] Take steps to avoid misestimating range query costs based on STAT4 data due to the roundoff error of converting from integers to LogEst and back to integers. (check-in: [3c933bf9] user: drh branch: trunk, size: 246500)
2014-10-21
18:16
[994b38c8] part of check-in [a27861c2] Further tuning of the cost estimates for skip-scan loops, especially for cases when skip-scan loops are in competition with regular loops. (check-in: [a27861c2] user: drh branch: trunk, size: 246526)
16:01
[45cb63cb] part of check-in [ec1e942f] Add WHERETRACE debugging output to the whereLoopAdjustCost() routine. (check-in: [ec1e942f] user: drh branch: trunk, size: 246666)
01:05
[2d1ff51e] part of check-in [f4b22a26] If a skip-scan is a proper subset of some other scan, then adjust the cost of the skip-scan upward so that it is more costly than the other scan. Such a cost imbalance can arise under STAT4 because of difficulties in getting an accurate estimate for skip-scans. (check-in: [f4b22a26] user: drh branch: trunk, size: 246372)
2014-10-11
02:12
[2947912f] part of check-in [7a32fdfd] Make sure that a GROUP BY that also implements an ORDER BY scans the table in the correct order. Fix for ticket [ba7cbfaedc7e6]. (check-in: [7a32fdfd] user: drh branch: trunk, size: 247233)
01:22
[45202a9a] part of check-in [c5dc83eb] Remove an unnecessary conditional from the EXPLAIN QUERY PLAN logic. (check-in: [c5dc83eb] user: drh branch: trunk, size: 247183)
2014-10-10
20:52
[7137da02] part of check-in [2a957396] Account for the ASC/DESC properties of ORDER BY expressions when using the same index for GROUP BY and ORDER BY. Candidate fix for [ba7cbfaedc]. (check-in: [2a957396] user: dan branch: experimental, size: 247482)
19:15
[75af78b4] part of check-in [c3012452] Restrict the scope of the explainIndexRange() function in where.c. (check-in: [c3012452] user: drh branch: trunk, size: 247271)
17:20
[b5112525] part of check-in [daa8314f] Add the estimated number of output rows to the EXPLAIN QUERY PLAN output if compiled with SQLITE_EXPLAIN_ESTIMATED_ROWS. This feature is off by default for the time being. (check-in: [daa8314f] user: drh branch: trunk, size: 247264)
15:47
[23b9e5dd] part of check-in [beea1efc] Simplify the code used to generate the text for EXPLAIN QUERY PLAN. (check-in: [beea1efc] user: drh branch: trunk, size: 247044)
15:01
[d1e315e3] part of check-in [68e1b4de] Fix a potential problem in the whereRangeScanEst() routine when STAT4 is active. The problem was introduced by recent enhancements. (check-in: [68e1b4de] user: drh branch: trunk, size: 247368)
2014-10-08
19:33
[6fe21e0f] part of check-in [42e48fd3] Remove an always-true branch in whereRangeScanEst(). Replace it with an assert(). (check-in: [42e48fd3] user: drh branch: trunk, size: 247406)
02:53
[982f1ce2] part of check-in [e3fe8400] Fix the STAT4 range scan estimates for DESC indexes. (check-in: [e3fe8400] user: drh branch: trunk, size: 247359)
00:08
[74e1f7e1] part of check-in [adcb3fed] More intuitive labels on ".wheretrace" output. (check-in: [adcb3fed] user: drh branch: trunk, size: 247139)
2014-09-30
17:31
[2f42fe0d] part of check-in [b6b28918] Enable the query planner to deal with WHERE clauses that have OR terms nested within AND terms that are nested within OR terms. Also remove an unused function declaration. (check-in: [b6b28918] user: drh branch: trunk, size: 247143)
17:03
[a459332d] part of check-in [670993eb] Further enhancements to the "wheretrace" debugging output. (check-in: [670993eb] user: drh branch: trunk, size: 247118)
14:14
[1d22623f] part of check-in [2e375eae] Enhanced debug output for OR-logic in the query loop optimizer. (check-in: [2e375eae] user: drh branch: trunk, size: 246755)
13:46
[5924c549] part of check-in [92e0b4bd] Show tree diagrams of data structures in the debugging output when the 0x100 bit is set on sqlite3WhereTrace or sqlite3SelectTrace. (check-in: [92e0b4bd] user: drh branch: trunk, size: 246547)
12:33
[5a2c700f] part of check-in [4ff51325] Remove the SQLITE_ENABLE_TREE_EXPLAIN compile-time option. Add alternative debugging display routines: sqlite3TreeViewExpr(), sqlite3TreeViewExprList(), and sqlite3TreeViewSelect(). (check-in: [4ff51325] user: drh branch: trunk, size: 245521)
2014-09-23
01:40
[a14d3d80] part of check-in [ae9a42b2] Adjust skip-scan cost estimates slightly so that a full table scan is preferred over a skip-scan to a column with only two distinct values. (check-in: [ae9a42b2] user: drh branch: trunk, size: 247403)
2014-09-22
14:30
[3f859ecf] part of check-in [41de1643] Tune the query planner to be more aggressive about using automatic indexes on views and subqueries for which there is not opportunity to declare a persistent schema index. (check-in: [41de1643] user: drh branch: trunk, size: 247233)
2014-09-19
02:01
[0888567c] part of check-in [72727b68] Make sure that the sorting-index pre-filter recognizes that a rowid reference might be sortable. This fixes a performance regression. (check-in: [72727b68] user: drh branch: Cplusplus-comment, size: 246775)
2014-09-16
14:37
[dc276288] part of check-in [8239c35a] Reduce the number of arguments to RecordCompare functions from 4 to 3, resulting in a small performance increase. (check-in: [8239c35a] user: drh branch: micro-optimizations, size: 246736)
2014-09-06
16:39
[839b5e1d] part of check-in [e62aab5e] Fix typos in comments. No code changes. (check-in: [e62aab5e] user: peter.d.reid branch: trunk, size: 246748)
02:00
[27af9678] part of check-in [a758465e] Fix a couple of typos in comments. No changes to code. (check-in: [a758465e] user: mistachkin branch: trunk, size: 246750)
01:35
[738213f2] part of check-in [73954f93] Query planner heuristic update: When doing a full table scan on a table that has an equality constraint on an unindexed column, do not allow the estimated number of output rows to be greater than half the total number of rows in the table. (check-in: [73954f93] user: drh branch: trunk, size: 246748)
2014-08-28
19:38
[d9eae96b] part of check-in [fdd478bb] Improved WHERETRACE messages for the estimated output row reductions from range scans. (check-in: [fdd478bb] user: drh branch: trunk, size: 246099)
17:20
[8214c301] part of check-in [6ba60952] Add a testcase() macro to help verfity the row estimation logic. (check-in: [6ba60952] user: drh branch: stat4-experimental, size: 245928)
16:01
[70dc8408] part of check-in [052d89b5] Fix a problem causing an inaccurate stat4-based estimate for the number of rows visited by a range scan. (check-in: [052d89b5] user: dan branch: stat4-experimental, size: 245856)
13:42
[2fd5cfaf] part of check-in [c931ca2b] Fix a formatting error ("%d" needed in place of "%g") on a WHERETRACE macro inside of the query planner. This fix applies to debugging logic only. (check-in: [c931ca2b] user: drh branch: trunk, size: 245803)
2014-08-27
17:37
[b80cb726] part of check-in [fcebca16] When determining whether or not a partial index is usable, do not assume that the cursor number assigned to each table in the query is the same as its index in the FROM clause. Fix for ticket [98d973b8f5]. (check-in: [fcebca16] user: dan branch: trunk, size: 245803)
2014-08-25
18:29
[4e2770a1] part of check-in [e06dc6f0] In cases where stat4 data is available but cannot be used because the rhs of a range constraint is too complex a expression, fall back to using the default estimates for number of rows scanned. (check-in: [e06dc6f0] user: dan branch: trunk, size: 245724)
2014-08-20
23:38
[4c499d18] part of check-in [bc985caa] Enhancements to skip-scan such that it is operable when a middle column of an index is skipped while the left-most column is constrained in the WHERE clause. (check-in: [bc985caa] user: drh branch: trunk, size: 245742)
2014-08-08
17:25
[ab20f9c2] part of check-in [43c59c85] Fix a buffer overrun in the previous commit. (check-in: [43c59c85] user: dan branch: query-planner-fix, size: 245269)
16:52
[012ef65a] part of check-in [299b9570] Because SQLite internally calculates query plan costs using a logarithmic scale, very large estimated sorting costs can cause all other estimated costs to be rounded down to zero. In these cases break ties between plans with the same total cost by comparing the costs with sorting excluded. This is an alternative fix for the problem addressed by [2af630c572]. (check-in: [299b9570] user: dan branch: query-planner-fix, size: 245062)
2014-08-07
20:37
[4cd4b362] part of check-in [b5e8fd57] Clarify the computation of compatible isOrdered by in the plan solver of the query planner. (check-in: [b5e8fd57] user: drh branch: query-planner-fix, size: 243143)
20:25
[5e4fe929] part of check-in [8f04d2c0] Remove the extraneous debugging printf() from the previous check-in. (check-in: [8f04d2c0] user: drh branch: query-planner-fix, size: 242936)
16:50
[5a099c6d] part of check-in [ec5d84ba] Oops! This check-in was on trunk. But it contains a debugging printf(). Original comment: When the estimated cost to do a sort overwhelms the estimated cost to do individual table lookups, make sure that the table lookup costs are still taken into consideration when selecting the lookup algorithm. (check-in: [ec5d84ba] user: drh branch: query-planner-fix, size: 243016)
2014-08-04
15:12
[93e9bec7] part of check-in [2f724cba] Changed my mind: This opcode name changes mere creates unnecessary diff marks between older and newer versions without significantly improving readability. Was: Rename the IsNull opcode to IfNull and rename the NotNull opcode to IfNotNull. (check-in: [2f724cba] user: drh branch: deadend, size: 241638)
2014-08-01
14:46
[ce1b9a3a] part of check-in [ee0fd6aa] Begin making changes to the IN operator in an attempt to make it run faster and to make the code easier to understand. (check-in: [ee0fd6aa] user: drh branch: IN-operator-improvements, size: 241638)
2014-07-31
22:59
[a7d0434d] part of check-in [e75b26ee] Refactoring: Change "pIndex->onError!=OE_None" to use a macro: "IsUniqueIndex(pIndex)". Easier to understand that way. (check-in: [e75b26ee] user: drh branch: trunk, size: 241623)
2014-07-24
22:41
[4dfcd803] part of check-in [6aea2258] Fix a bug in the whereRangeSkipScanEst() procedure (added by check-in [d09ca6d5efad3e4cfa]) where it fails to consider the possibility of a ROWID column when computing the affinity of a table column. (check-in: [6aea2258] user: drh branch: trunk, size: 241633)
2014-07-23
23:57
[9454af8e] part of check-in [729ece40] Add experimental "costmult" logic. Only enabled when compiled with -DSQLITE_ENABLE_COSTMULT. (check-in: [729ece40] user: drh branch: trunk, size: 241585)
2014-07-22
20:02
[0ffd586e] part of check-in [77f412ca] 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. (check-in: [77f412ca] user: drh branch: trunk, size: 241116)
19:14
[4e7e6bc6] part of check-in [eed754fe] The optimization of check-in [b67a6e33f2] does not work (it generates incorrect VDBE code) if an OR term is AND-ed with a constant expression. So back that optimization out and add a test case to make sure it does not get added back in. (check-in: [eed754fe] user: drh branch: trunk, size: 240899)
14:42
[52edd7f5] part of check-in [b083a961] Expire prepared statements after running ANALYZE. (check-in: [b083a961] user: drh branch: trunk, size: 241667)
12:05
[00c4b52d] part of check-in [b22dd165] Enhance the comment on whereLoopAddBtree(). No changes to code. (check-in: [b22dd165] user: drh branch: trunk, size: 241712)
00:40
[4f8dce8f] part of check-in [b67a6e33] For the OR-optimization, avoid generating OP_OpenRead opcodes that reopen exactly the same index. (check-in: [b67a6e33] user: drh branch: trunk, size: 241239)
2014-07-15
11:59
[907fd82f] part of check-in [1efa6ed5] Add simple tests for new sqlite3BtreeCursorHint() functionality. (check-in: [1efa6ed5] user: dan branch: cursor-hints, size: 221604)
2014-07-14
19:04
[dcea6104] part of check-in [f9dddd00] In the expression passed to sqlite3BtreeCursorHint() for the inner loops of joins, replace any TK_COLUMN references to columns in the outer loops with TK_REGISTER expressions (Expr.iTable indicates the specific register containing the value). There are no automated tests for this yet. (check-in: [f9dddd00] user: dan branch: cursor-hints, size: 221619)
2014-07-01
11:54
[3a451b00] part of check-in [21981e35] Ensure that all fields are loaded from the stat4 table for records that correspond to indexes on WITHOUT ROWID tables with composite primary keys. (check-in: [21981e35] user: dan branch: trunk, size: 240471)
2014-06-30
19:07
[6ff6f7e3] part of check-in [d09ca6d5] Attempt to use STAT4 information to estimate the selectivity of WHERE clause terms when using the skip-scan optimization. (check-in: [d09ca6d5] user: drh branch: trunk, size: 240498)
18:02
[2bc0226f] part of check-in [053a210e] Fix a problem in where.c with using the stat4 sample data of an index on a WITHOUT ROWID table. (check-in: [053a210e] user: dan branch: stat4-without-rowid, size: 236088)
15:23
[da15506c] part of check-in [6624a61d] Fix where.c so that the primary key values appended to every index entry on a WITHOUT ROWID table may be used when useful. (check-in: [6624a61d] user: dan branch: stat4-without-rowid, size: 236091)
2014-06-28
15:26
[84659c30] part of check-in [dfb09db6] Fix a problem with using stat4 samples of type text when estimating the rows visited by a range-query/skip-scan loop. (check-in: [dfb09db6] user: dan branch: stat4-skipscan, size: 240597)
14:28
[1f448161] part of check-in [d186d1ac] Change the VDBE to export the sqlite3MemCompare() routine and thus free where.c from the dependency on vdbeInt.h. (check-in: [d186d1ac] user: drh branch: stat4-skipscan, size: 240607)
2014-06-27
20:14
[fea270ae] part of check-in [219736f5] Fix a couple of problems in estimating the number of rows visited by a range query that uses a skip-scan. (check-in: [219736f5] user: dan branch: stat4-skipscan, size: 240628)
2014-06-26
21:32
[0396f040] part of check-in [74a5454a] Fix compilation issue when STAT4 is not enabled. (check-in: [74a5454a] user: mistachkin branch: stat4-skipscan, size: 239985)
20:21
[643abd2d] part of check-in [01dc8102] Attempt to use sqlite_stat4 data to estimate the number of rows visited by a range query that uses a skip-scan. This code is largely untested. (check-in: [01dc8102] user: dan branch: stat4-skipscan, size: 239907)
2014-06-18
15:11
[7b9e13cf] part of check-in [0a52bddd] Prevent an automatic index from taking the place of a declared index. (check-in: [0a52bddd] user: drh branch: trunk, size: 236187)
2014-06-17
20:16
[0035f45d] part of check-in [4ece839d] Prevent an automatic index from taking the place of a declared index. (check-in: [4ece839d] user: drh branch: autoindex-improvements, size: 236186)
17:00
[7f59d378] part of check-in [b500f2a0] Fix a missing space in a "wheretrace" comment. No changes to production code. (check-in: [b500f2a0] user: drh branch: trunk, size: 235795)
15:13
[9ec7ce02] part of check-in [2d9de154] Small tweaks to the query planner to get it to try harder to use an index for sorting and to avoid using automatic indexes on constant terms. (check-in: [2d9de154] user: drh branch: branch-3.8.3, size: 219338)
12:33
[cd3110c7] part of check-in [f270fb6e] A different approach to the autoindex problem that deletes query-planner code rather than adding it. (check-in: [f270fb6e] user: drh branch: autoindex-improvements, size: 235794)
09:52
[3214e390] part of check-in [36d67e1d] Simplification to the logic that prevents automatic indexes from being formed on constant expressions. (check-in: [36d67e1d] user: drh branch: autoindex-improvements, size: 236172)
09:00
[d6a284ab] part of check-in [58acc2a8] Allow an automatic index on a WHERE constraint where the RHS is does not reference another table as long as the RHS is not a constant. (check-in: [58acc2a8] user: drh branch: autoindex-improvements, size: 236221)
02:46
[46e94a51] part of check-in [d6883e96] Do not attempt to create an automatic index on a constant constraint, as doing so is pointless. (check-in: [d6883e96] user: drh branch: autoindex-improvements, size: 236150)
2014-06-16
21:30
[5ee08882] part of check-in [3181d206] In the "wheretrace" logic (disabled for normal builds) expand the print width of the flags field to be wide enough for all 17 bits. (check-in: [3181d206] user: drh branch: trunk, size: 236106)
2014-06-12
15:46
[77894326] part of check-in [6c68d758] Simplify the estLog() routine. (check-in: [6c68d758] user: drh branch: trunk, size: 236106)
2014-06-06
20:20
[1c0a0b1f] part of check-in [75437bee] Make sure the estLog() routine in the query planner handles negative values correctly (always returning 1). Prior to this change, estLog(-1) would return a large number which could throw off the cost computations in the query planner in obscure circumstances. (check-in: [75437bee] user: drh branch: trunk, size: 236131)
17:09
[b6dc8189] part of check-in [b16bf851] Fix an obsolete comment on the whereRangeScanEst() routine. No changes to code. (check-in: [b16bf851] user: drh branch: trunk, size: 236121)
2014-06-02
21:00
[a7d59dd5] part of check-in [1cbe7a08] Remove the WHERE_LIKELIHOOD bit, as it does not seem to effect any result. (check-in: [1cbe7a08] user: drh branch: trunk, size: 236119)
11:26
[308ed08c] part of check-in [9f18b303] Fix the query planner so that it once again knows that queries without a FROM clause will never return more than one row and hence do not require sorting. (check-in: [9f18b303] user: drh branch: trunk, size: 236212)
2014-05-27
18:18
[b3be5eb4] part of check-in [d16e575d] Change the name of the Index.autoIndex field to Index.idxType and provide symbolic names for the various values of that field rather than using magic numbers. (check-in: [d16e575d] user: drh branch: trunk, size: 236198)
17:57
[a2dba34b] part of check-in [9c785c58] Avoid unnecessary cursor opens and seeks when running the OR-optimization on a WITHOUT ROWID table. (check-in: [9c785c58] user: drh branch: trunk, size: 236182)
16:41
[c0d3d347] part of check-in [77fef5a3] Improved comments on the OR-optimization logic in the query planner. (check-in: [77fef5a3] user: drh branch: trunk, size: 235754)
2014-05-26
22:01
[b5719b11] part of check-in [cbec30d0] Minor enhancements to comments and clarification of the code. (check-in: [cbec30d0] user: drh branch: without-rowid-or-opt, size: 234993)
20:25
[d46d73c7] part of check-in [b4980a07] Add a missing VdbeCoverage() macro on an OP_Found opcode added in the previous check-in. (check-in: [b4980a07] user: drh branch: without-rowid-or-opt, size: 234883)
20:06
[a911a484] part of check-in [2c7e277b] Enable the OR optimization for WITHOUT ROWID tables. Use a temp table instead of the RowSet object to track the rows that have already been included in the result set. (check-in: [2c7e277b] user: dan branch: without-rowid-or-opt, size: 234850)
2014-05-23
17:17
[9d351a5e] part of check-in [9268df30] Changes to the output of EXPLAIN QUERY PLAN to make it clearer when a query uses the PRIMARY KEY index of a WITHOUT ROWID table. (check-in: [9268df30] user: dan branch: trunk, size: 232722)
2014-05-19
15:16
[5733d54d] part of check-in [17349a49] Changes to help ensure that a multiplication does not overflow when computing the number of bytes needed for a memory allocation, and cause a malfunction. No problems existing problems were discovered. However, these changes should help to ensure that no problems arise in the future. (check-in: [17349a49] user: drh branch: safer-malloc, size: 232477)
2014-05-07
20:33
[fd4b525c] part of check-in [68766f83] Remove a superfluous variable initialization. (check-in: [68766f83] user: drh branch: trunk, size: 232447)
2014-05-06
15:28
[b8df0204] part of check-in [8ad0a123] Experimental changes that reduce the size of Expr objects from 72 to 64 bytes each on x64 and from 48 to 44 bytes each on x32. (check-in: [8ad0a123] user: drh branch: smaller-expr, size: 233373)
2014-05-02
00:09
[91dfd382] part of check-in [3bc43594] Add a comment explaining why WhereLoop cost adjustments are omitted for skip-scan loops. (check-in: [3bc43594] user: drh branch: trunk, size: 232452)
2014-05-01
20:24
[9e67d6c4] part of check-in [be2702ce] Add #ifdefs for test coverage. Add a testcase(). (check-in: [be2702ce] user: drh branch: trunk, size: 231761)
2014-04-30
18:11
[3eaf3d24] part of check-in [9bbca48b] Fix a problem in calculating the costs of "OR" scans. (check-in: [9bbca48b] user: dan branch: trunk, size: 231728)
15:00
[4aeb1caa] part of check-in [05e6e16c] Add text to the header comment of whereLoopAddBtree() describing how the costs of various b-tree loops are estimated. (check-in: [05e6e16c] user: dan branch: experimental-costs, size: 230997)
14:47
[e91b9290] part of check-in [eefeda32] Fix a couple of out-of-date comments in where.c. (check-in: [eefeda32] user: dan branch: experimental-costs, size: 229932)
2014-04-29
16:46
[9651faf0] part of check-in [d74299f0] Merge trunk changes into this branch. (check-in: [d74299f0] user: dan branch: experimental-costs, size: 229371)
16:10
[397bd5d4] part of check-in [5bb7757a] Ignore likelihood() values on indexed IPK lookups. (check-in: [5bb7757a] user: dan branch: experimental-costs, size: 229629)
2014-04-28
20:11
[da9c2c1d] part of check-in [a8ae93f0] Do not reduce the number of rows scanned at all for "IS NOT NULL" constraints. Fix a bug in calculating the number of rows visited by scans of partial indicies. (check-in: [a8ae93f0] user: dan branch: experimental-costs, size: 229618)
19:34
[0a518940] part of check-in [4047ac75] The trunk assumes that an open range constraint on an indexed term (col>?) term matches 1/4 of the indexed rows, and that a closed constraint (col BETWEEN ? AND ?) matches 1/64. Change this branch to do the same. (check-in: [4047ac75] user: dan branch: experimental-costs, size: 229583)
09:35
[263f8940] part of check-in [88a5758d] Modify internal function whereLoopAdjustCost() so that it does not prefer a skip-scan over a regular index scan even if the regular scan uses a subset of the WHERE terms used by the skip-scan. (check-in: [88a5758d] user: dan branch: experimental-costs, size: 229207)
08:49
[d4efd09b] part of check-in [d491de62] Fix an error in estimating of the number of rows visited by a range scan. (check-in: [d491de62] user: dan branch: experimental-costs, size: 229097)
2014-04-26
20:21
[488cc018] part of check-in [dee20409] Fix an sqlite3_stmt_status() problem caused by recent changs on this branch. (check-in: [dee20409] user: dan branch: experimental-costs, size: 229000)
2014-04-25
20:22
[2b3f4780] part of check-in [c51efaa5] If the user provides likelihood() data for a WHERE clause term used as part of an index key, have the planner use it when calculating the expected number of rows visited by the loop. (check-in: [c51efaa5] user: dan branch: experimental-costs, size: 228921)
15:01
[15a5c94c] part of check-in [1bd74c49] Store values loaded from the stat1 table as logarithmic values in memory. (check-in: [1bd74c49] user: dan branch: experimental-costs, size: 228111)
14:42
[6ae02f1e] part of check-in [17113812] Make sure ORDER BY clauses on joins that involve virtual tables and that have a DISTINCT clause work correctly. This is a candidate fix for ticket [388d01d4bb8f9]. Test cases for that ticket will be checked in separately. (check-in: [17113812] user: drh branch: trunk, size: 228169)
2014-04-24
20:04
[c12bc20c] part of check-in [c5a6ec0a] Changes to the way the planner calculates the costs of various table and index scans. Some test cases still failing. (check-in: [c5a6ec0a] user: dan branch: experimental-costs, size: 228072)
2014-04-21
13:21
[3b127bdc] part of check-in [de9a490f] Avoid discarding an ORDER BY clause in the case where an identical GROUP BY clauses uses an index to group, but not sort, the rows. Fix for [b75a9ca6b0]. (check-in: [de9a490f] user: dan branch: trunk, size: 228427)
2014-04-18
22:20
[114b480d] part of check-in [9a5d38c7] Clean up the proper-subset cost adjustment logic to make it more compact and easier to read and so that full branch test coverage is more easily obtained. (check-in: [9a5d38c7] user: drh branch: trunk, size: 226950)
2014-04-13
19:28
[7614c438] part of check-in [ab23abf3] Remove the unused second argument from sqlite3ExprCachePop(). Add an ALWAYS() on an always-true conditional in sqlite3VdbeResolveLabel(). (check-in: [ab23abf3] user: drh branch: trunk, size: 226344)
2014-04-04
18:20
[70eb10da] part of check-in [683dd379] Merge changes to the query planner that strive to ensure that any index usage that is a proper subset of some other index usage always has a slightly higher cost. (check-in: [683dd379] user: drh branch: trunk, size: 226347)
2014-04-03
16:29
[ebad891b] part of check-in [d5513dfa] Use OP_Copy instead of OP_SCopy when moving results out of a subquery, to prevent the subquery results from changing out from under the outer query. Fix for ticket [98825a79ce1456]. Problem introduced by check-in [1e64dd782a126f48d78]. (check-in: [d5513dfa] user: drh branch: trunk, size: 223450)
16:16
[7e56746c] part of check-in [ec6a0624] Use OP_Copy instead of OP_SCopy when moving results out of a subquery, to prevent the subquery results from changing out from under the outer query. Fix for ticket [98825a79ce1456]. Problem introduced by check-in [1e64dd782a126f48d78]. (check-in: [ec6a0624] user: drh branch: branch-3.8.4, size: 221227)
2014-03-31
20:05
[7b5010f5] part of check-in [7473c4df] Remove an unnecessary conditional. (check-in: [7473c4df] user: drh branch: query-plan-experiments, size: 226348)
19:49
[182f16d9] part of check-in [b7830d23] Also make sure an index that is a proper subset of some other index has a higher cost than that other index. Add test cases. (check-in: [b7830d23] user: drh branch: query-plan-experiments, size: 226319)
18:24
[50ac3154] part of check-in [ea8b0910] Make sure that an index that covers a proper superset of the WHERE clause terms of some other index has a lower cost than the other index. (check-in: [ea8b0910] user: drh branch: query-plan-experiments, size: 226114)
2014-03-29
21:16
[26c6f626] part of check-in [8f869ca7] Experiments in picking better query plans, especially when the usage of one index is a subset of another. (check-in: [8f869ca7] user: drh branch: query-plan-experiments, size: 224832)
2014-03-28
12:56
[7d539ced] part of check-in [a4e47150] Fix a harmless compiler warning. (check-in: [a4e47150] user: drh branch: trunk, size: 223451)
2014-03-27
18:36
[7c53de68] part of check-in [9b4d7226] Minor cleanup of the code in the query planner that computes the costs estimates for the various plans. There are no changes to the costs at this time. But the code is slightly more readable now and that might facilitate future enhancements. (check-in: [9b4d7226] user: drh branch: trunk, size: 223447)
2014-03-22
00:27
[da8ec216] part of check-in [c36f7461] Fix the ORDER BY optimization logic so that it will do a block-sort on a partial DESC ORDER BY. This enhancement uncovered a memory leak in pushUntoSorter() which is also fixed. (check-in: [c36f7461] user: drh branch: trunk, size: 222114)
2014-03-21
18:45
[f394453e] part of check-in [71e9ae72] Merge the OFFSET-on-query-without-FROM fix from trunk. (check-in: [71e9ae72] user: drh branch: orderby-planning, size: 222122)
18:16
[eed0b83b] part of check-in [179ef816] Fix the OFFSET clause so that it works correctly on queries that lack a FROM clause. Ticket [07d6a0453d4ed8]. (check-in: [179ef816] user: drh branch: trunk, size: 221395)
2014-03-20
20:56
[d6d99a4d] part of check-in [eca35871] Merge trunk fixes for "x IN (?)" handling. (check-in: [eca35871] user: drh branch: orderby-planning, size: 222068)
13:26
[a2f20bdc] part of check-in [e68b427a] Convert expressions of the form "X IN (?)" with exactly one value on the RHS of the IN into equality tests: "X=?". Add test cases to verify that statements work correctly on this corner case. Fix for ticket [e39d032577df6942]. (check-in: [e68b427a] user: drh branch: trunk, size: 221341)
12:36
[09246177] part of check-in [eae6dfbe] One possible fix for the [e39d032577d] problem it to replace the failing assert() with a testcase() as shown here. (check-in: [eae6dfbe] user: drh branch: tkt-e39d0325, size: 221286)
12:17
[e433accd] part of check-in [ca314081] Fix an unnecessarily obtuse use of a bitmask flag. (check-in: [ca314081] user: drh branch: trunk, size: 221207)
2014-03-19
23:24
[7c74debe] part of check-in [01afbf97] Fix query planner weights associated with choosing block-sorting. Fix block sorting of tables with collating functions. Fix various test cases. All "veryquick" tests are now passing, though more tests need to be added. (check-in: [01afbf97] user: drh branch: orderby-planning, size: 221955)
14:30
[1757f31c] part of check-in [b186d8d1] Make sure the where.c query planner never reports that the number of ORDER BY terms that are satisfied by indices is negative. (check-in: [b186d8d1] user: drh branch: orderby-planning, size: 221639)
14:10
[d4739c39] part of check-in [59742dd4] First attempt at getting block-sort to work. This is an incremental check-in. There are many problems still to be worked out. (check-in: [59742dd4] user: drh branch: orderby-planning, size: 221590)
2014-03-18
20:33
[3f5de18e] part of check-in [e258df23] Make the partial-ORDER-BY information in the query planner available to the SELECT code generator. Still doesn't make a difference in the generated code. (check-in: [e258df23] user: drh branch: orderby-planning, size: 221570)
18:59
[81eea5ce] part of check-in [59d49b7f] Adjust the query planner to keep track of the number of ORDER BY terms satisfied. Still doesn't do anything with this information. Some tests fail after this check-in, but all failures are believed to be benign. The failures will be addressed at a later stage. (check-in: [59d49b7f] user: drh branch: orderby-planning, size: 221376)
15:30
[222e6ed5] part of check-in [b1509025] Experiments with the optimization of ORDER BY and GROUP BY clauses. (check-in: [b1509025] user: drh branch: orderby-planning, size: 220994)
2014-03-10
20:12
[bb50b5ae] part of check-in [0769eebd] Adjustments to the cost computation for the skip-scan query plan, to take into account the fact that a seek has to occur on each skip. (check-in: [0769eebd] user: drh branch: trunk, size: 221228)
2014-03-06
12:36
[95d30485] part of check-in [4a499722] Remove a branch that is never taken from where.c. (check-in: [4a499722] user: dan branch: trunk, size: 221139)
2014-03-03
14:45
[2269342f] part of check-in [e00ed717] Merge latest trunk changes. (check-in: [e00ed717] user: dan branch: experimental, size: 221118)
14:20
[e4b57d81] part of check-in [7fdd378d] Fix a segfault that can occur following an OOM error. (check-in: [7fdd378d] user: dan branch: trunk, size: 221106)
2014-03-01
19:44
[36ef94b6] part of check-in [3861e853] Remove the vdbeRecordCompareLargeHeader function. Fix some other details. (check-in: [3861e853] user: dan branch: experimental, size: 221097)
2014-02-26
19:05
[655b8fc1] part of check-in [3ad687b7] Only run the OP_OpenRead opcodes for a correlated subquery once, on the initial iteration. Keep the cursor open for subsequent runs. This was suppose to be a performance enhancement, but it is difficult to come up with a query where is makes a significant difference. Hence, the change is getting parked in a branch. (check-in: [3ad687b7] user: drh branch: open-only-once, size: 221297)
02:26
[6042e1a3] part of check-in [dca1945a] Improved handling of constants and especially constant functions in the ORDER BY clause of a query. Do not optimize out "ORDER BY random()". Fix for ticket [65bdeb9739605cc2296]. (check-in: [dca1945a] user: drh branch: trunk, size: 221085)
2014-02-25
21:55
[0b5a4d45] part of check-in [97a8c973] Do not allow temporary registers to be in use across an OP_Yield within a co-routine. Fix for ticket [8c63ff0eca81a9132d8]. (check-in: [97a8c973] user: drh branch: trunk, size: 221489)
2014-02-18
03:07
[d622974f] part of check-in [b92d31a9] Add VdbeCoverage() and VdbeCoverageIf() macros for improved VDBE coverage testing. (check-in: [b92d31a9] user: drh branch: trunk, size: 221519)
2014-02-17
22:40
[7825dce3] part of check-in [ce184c7b] Add logic to do test coverage measurements on the VDBE code. (check-in: [ce184c7b] user: drh branch: insert-optimization, size: 220476)
2014-02-14
23:49
[7d9c9887] part of check-in [e07a32f3] Seek past NULLs in a top-constrained search. Avoid checking for NULLs in the body of the search. (check-in: [e07a32f3] user: drh branch: trunk, size: 219787)
20:59
[bf849f08] part of check-in [3c1ae447] Reduce the number of cases where it is necessary to check for NULL after the loop terminating condition. (check-in: [3c1ae447] user: drh branch: trunk, size: 220065)
15:13
[43eb827f] part of check-in [b6bea903] Add OP_IdxGT and OP_IdxLE as distinct opcodes. Formerly these operations where done using OP_IdxGE and OP_IdxLT with the P5 flag set. But VDBE code is easier to read with distinct opcode names. Also change OP_SeekGe to OP_SeekGE, and so forth, so that the capitalization is consistent. The whole point of this change is to improve the readability of VDBE listings. (check-in: [b6bea903] user: drh branch: trunk, size: 220150)
2014-02-11
03:50
[540f5238] part of check-in [de635e09] Make sure that virtual WHERE-clause terms do not get transformed into real terms when processing set of OR-connected terms. Fix for ticket [4c86b126f22ad]. (check-in: [de635e09] user: drh branch: branch-3.8.3, size: 219267)
01:50
[b0436385] part of check-in [c950d6c4] Make sure that virtual WHERE-clause terms do not get transformed into real terms when processing set of OR-connected terms. Fix for ticket [4c86b126f22ad]. (check-in: [c950d6c4] user: drh branch: trunk, size: 220057)
2014-02-08
23:20
[90fef20d] part of check-in [1e64dd78] Do away with the "multi-register pseudo-table" abstration. Instead, just use an OP_SCopy to load results directory from the result registers of the co-routine. (check-in: [1e64dd78] user: drh branch: trunk, size: 219929)
13:12
[30fd77c3] part of check-in [129217ee] Tweaks to the generated VDBE code to make it a little easier to follow. (check-in: [129217ee] user: drh branch: trunk, size: 219192)
01:40
[924f24a0] part of check-in [192dea97] Change the OP_Trace opcode to OP_Init and give it the ability to jump to the initialization code at the bottom of the program, thus avoiding the need for an extra OP_Goto. (check-in: [192dea97] user: drh branch: trunk, size: 219199)
2014-02-07
19:18
[8c2aada8] part of check-in [a522f364] Change the OP_InitCoroutine instruction to jump over the co-routine implementation. (check-in: [a522f364] user: drh branch: coroutine-refactor, size: 219263)
18:27
[07179d15] part of check-in [1ec0e9dd] Get rid of the OP_Undef and OP_IsUndef opcodes in favor of higher-level OP_InitCoroutine and OP_EndCoroutine. (check-in: [1ec0e9dd] user: drh branch: coroutine-refactor, size: 219260)
2014-02-06
03:31
[08730727] part of check-in [715fac77] Use OpenHash instead of OpenEphemeral for the RHS of IN operators if the result is not needed for sorting. (check-in: [715fac77] user: drh branch: subquery-codegen-refactor, size: 219522)
2014-02-03
14:04
[bacb79fb] part of check-in [6c643e45] Provide hints to the btree layer Next and Previous primitives to let them know if they can be no-ops if the underlying index is unique. (check-in: [6c643e45] user: drh branch: trunk, size: 219301)
2014-01-28
00:49
[549067bd] part of check-in [a2c347fa] Provide hints to the btree layer Next and Previous primitives to let them know if they can be no-ops if the underlying index is unique. (check-in: [a2c347fa] user: drh branch: branch-3.8.2, size: 218779)
2014-01-22
10:22
[67ae3b5e] part of check-in [cceacc0e] Fix a typo in a comment. No changes to code or tests. (check-in: [cceacc0e] user: dan branch: cte-via-queue, size: 219139)
00:23
[943bb821] part of check-in [5e6c4a55] Remove an unnecessary parameter from selectInnerLoop(). Clean up comments. (check-in: [5e6c4a55] user: drh branch: cte-via-queue, size: 219141)
2014-01-21
22:25
[d908f4e9] part of check-in [b2671e11] Change the recursive common table expression algorithm to use a queue instead of a pair of tables. Runs about 25% faster on the sudoku solver query. The OP_SwapCursors opcode is no longer required. The current implementation uses just a fifo, but the plan is to change it into a queue that will support ORDER BY and LIMIT in a recursive query. (check-in: [b2671e11] user: drh branch: cte-via-queue, size: 218993)
2014-01-20
19:55
[56f85486] part of check-in [7d9e2218] In where.c, do not allocate space in sqlite3_index_info structures for the internal WHERE clause "terms" generated to record column equivalencies. Fix for ticket [1a1a194d1e5f8]. (check-in: [7d9e2218] user: dan branch: trunk, size: 218907)
2014-01-17
15:15
[5e11de48] part of check-in [0171e3bb] Add support for common table expressions (WITH clauses). (check-in: [0171e3bb] user: dan branch: trunk, size: 218791)
2014-01-16
18:34
[369b0259] part of check-in [a296b733] Allow only a single recursive reference in a recursive CTE. Also require that this reference is not part of a sub-query. (check-in: [a296b733] user: dan branch: common-table-expr, size: 218767)
15:31
[81cec50f] part of check-in [16bd5478] Always use available indices to optimize LIKE operators even if the pattern of the LIKE operator has a COLLATE modifier. This fixes an ineffiency that was introduced into 3.7.15 by check-in [8542e6180d4] on 2012-12-08. (check-in: [16bd5478] user: drh branch: trunk, size: 218766)
2014-01-15
19:42
[27eb508c] part of check-in [3908e2ea] Fixes so that SQLITE_OMIT_CTE builds work. (check-in: [3908e2ea] user: dan branch: common-table-expr, size: 218963)
18:21
[9448a176] part of check-in [28aa6db8] Disable automatic indices on recursive CTE references. (check-in: [28aa6db8] user: dan branch: common-table-expr, size: 218932)
2014-01-14
20:14
[830b42f4] part of check-in [a5c2a54a] Add code to handle recursive CTEs. (check-in: [a5c2a54a] user: dan branch: common-table-expr, size: 218907)
2014-01-04
19:27
[18f07fd0] part of check-in [8f6e6149] Avoid redundant register loads during index key generation when doing a DELETE or INTEGRITY_CHECK on a table with multiple indices. (check-in: [8f6e6149] user: drh branch: trunk, size: 218742)
14:16
[14403429] part of check-in [19f3208b] Have the planner detect cases where a MATCH constraint is applied to a virtual table, and ignore any plans that do not allow the virtual table implementation to implement the MATCH filtering. (check-in: [19f3208b] user: dan branch: avoid-unusable-match, size: 219083)
2014-01-02
21:05
[8e3cb203] part of check-in [9d05777f] Try to factor constant subcomponents of the WHERE clause out of the loop. (check-in: [9d05777f] user: drh branch: trunk, size: 218736)
2013-12-23
15:35
[3b589eee] part of check-in [ac5852d6] Make sure the WhereLoop.aLTerm[] array is large enough when processing the skip-scan optimization. Fix for ticket [520070ec7fbaac]. (check-in: [ac5852d6] user: drh branch: branch-3.8.2, size: 218617)
2013-12-22
20:44
[60bc8c5b] part of check-in [46d04059] Make sure the WhereLoop.aLTerm[] array is large enough when processing the skip-scan optimization. Fix for ticket [520070ec7fbaac]. (check-in: [46d04059] user: drh branch: trunk, size: 218615)
2013-12-09
19:03
[b8f3aab1] part of check-in [9227ad48] Performance optimizations for sqlite3VXPrintf(). (check-in: [9227ad48] user: drh branch: trunk, size: 218549)
2013-12-07
23:35
[34cf7697] part of check-in [bfefc575] Do not allow cursor hints to use expressions containing subqueries. This change fixes the problem seen in the previous check-in. (check-in: [bfefc575] user: drh branch: cursor-hints, size: 219940)
20:39
[c3bdcd38] part of check-in [3a9bec52] If the SQLITE_ENABLE_CURSOR_HINTS macro is defined, then invoke the sqlite3BtreeCursorHint() interface to provide hints to the storage engine about rows that need not be returned. Hints can be disabled using SQLITE_TESTCTRL_OPTIMIZATIONS with SQLITE_CursorHints (0x2000). Cursor hints are not used by the built-in storage engine of SQLite but might be useful to applications that provide their own storage engine. The current code is work-in-progrss and contains bugs. (check-in: [3a9bec52] user: drh branch: cursor-hints, size: 219878)
2013-12-03
19:49
[e6a4e713] part of check-in [eca7d3f1] Remove a branch in STAT4 logic that is no longer reachable after the previous change. (check-in: [eca7d3f1] user: drh branch: trunk, size: 218551)
2013-11-27
04:22
[e0a9909a] part of check-in [83c0bb99] Lower the threshold for using skip-scan from 50 to 18, based on experiments that show that 18 is the approximate break-even point for a variety of schemas. (check-in: [83c0bb99] user: drh branch: trunk, size: 218603)
2013-11-21
03:12
[e558bfa6] part of check-in [ecaac28a] Performance optimization to the OP_Next and OP_Prev opcodes. (check-in: [ecaac28a] user: drh branch: trunk, size: 218471)
2013-11-19
12:33
[aa72ba87] part of check-in [3e577f40] Change Noop-comments in where.c into Module-comments, so that they are omitting without SQLITE_ENABLE_MODULE_COMMENTS. (check-in: [3e577f40] user: drh branch: trunk, size: 218459)
2013-11-18
19:32
[c0a9bab3] part of check-in [e9df04ce] Add comments identifing where the skip-scan option is decided in the query planner, to aid in tuning that decision. No changes to code. (check-in: [e9df04ce] user: drh branch: trunk, size: 218449)
2013-11-16
14:03
[de64e326] part of check-in [de08a7e7] Avoid unnecessary OP_IfNull checks when doing a range query where there is a constraint on the lower bound of the range. (check-in: [de08a7e7] user: drh branch: trunk, size: 218199)
2013-11-15
18:15
[c7d50e26] part of check-in [d10fb49a] Changes to make the new constant expression factoring logic more general and more testable. (check-in: [d10fb49a] user: drh branch: expr-codegen-enhancement, size: 218144)
12:41
[6e7e932e] part of check-in [372686bf] Simplify the range scan code generate while also avoiding an unnecessary OP_Affinity opcode. (check-in: [372686bf] user: drh branch: expr-codegen-enhancement, size: 218195)
01:10
[9bff77c9] part of check-in [8dc5c76c] Rework the logic that factors constant expressions out of inner loops, making it both simpler and faster. (check-in: [8dc5c76c] user: drh branch: expr-codegen-enhancement, size: 218482)
2013-11-14
19:34
[9d0b21b6] part of check-in [10d59226] Remove an unused local variable. (check-in: [10d59226] user: drh branch: trunk, size: 218526)
2013-11-13
19:01
[2eb88f96] part of check-in [f668616a] Import the "PRAGMA vdbe_eqp" enhancement and the enhanced EXPLAIN formatting the shell from trunk. Fix a bug in skip-scan and add a test case to prevent a regression. (check-in: [f668616a] user: drh branch: skip-scan, size: 218575)
17:58
[537f4d7e] part of check-in [8ce33f4c] Add the "PRAGMA vdbe_eqp" command, only available with SQLITE_DEBUG. Simplify some of the other debugging logic. (check-in: [8ce33f4c] user: drh branch: trunk, size: 216205)
17:24
[1d19a1d4] part of check-in [0c85d93b] Add VDBE comments to the beginning and end of skip-scan loops. (check-in: [0c85d93b] user: drh branch: skip-scan, size: 218516)
16:58
[f50428d2] part of check-in [5e75ab93] Improve the way that skip-scan loops are constructued. Add test cases. Improved the scoring of skip-scan loops. (check-in: [5e75ab93] user: drh branch: skip-scan, size: 218378)
12:27
[15170b15] part of check-in [27dd5993] Add the ability to use an index even if the left-most columns of the index are unconstrainted, provided that the left-most columns have few distinct values. (check-in: [27dd5993] user: drh branch: skip-scan, size: 218367)
08:55
[346944c2] part of check-in [51960009] Avoid an unnecessary OP_IfNull while doing an indexed search. (check-in: [51960009] user: drh branch: trunk, size: 216174)
2013-11-12
20:18
[48404454] part of check-in [0d1328e3] Minor enhancements to the auxiliary information added to EXPLAIN output with SQLITE_EXPLAIN_ENABLE_COMMENTS. (check-in: [0d1328e3] user: drh branch: trunk, size: 216030)
18:37
[7ce9564f] part of check-in [c4446712] Break out the structure and macro definitions of where.c into a separate header file whereInt.h for easier editing and debugging. (check-in: [c4446712] user: drh branch: trunk, size: 215947)
12:17
[a80cab07] part of check-in [e2684ece] Fix for [4065ac8595]: Do not order CROSS or LEFT joins, even if the right-hand-side is a virtual table. (check-in: [e2684ece] user: dan branch: trunk, size: 236483)
2013-11-11
19:01
[85766647] part of check-in [5a3cfd74] Add a way for virtual tables to return the expected number of rows for a scan (not just the overall cost) to SQLite. Have the rtree module make use of this. (check-in: [5a3cfd74] user: dan branch: trunk, size: 236507)
16:55
[2c2a5931] part of check-in [924d63b2] Remove unreachable code, replacing it in most cases with assert() or NEVER() macros. (check-in: [924d63b2] user: drh branch: trunk, size: 236467)
2013-11-08
17:13
[748cabee] part of check-in [0077c077] Fix harmless compiler warnings. (check-in: [0077c077] user: drh branch: trunk, size: 236319)
15:19
[1b5780b6] part of check-in [6f187a0f] Performance improvements: Avoid unnecessary seeks when doing a single-row UPDATE on a WITHOUT ROWID table. (check-in: [6f187a0f] user: drh branch: trunk, size: 236317)
2013-11-07
21:25
[30462cf0] part of check-in [21530798] Enable the WHERE_ONEPASS_DESIRED optimization for UPDATE operations on WITHOUT ROWID tables. (check-in: [21530798] user: drh branch: trunk, size: 234206)
2013-11-06
19:59
[1a99f127] part of check-in [defd5205] Reference count the KeyInfo object. Cache a copy of an appropriate KeyInfo for each index in the Index object, and reuse that one copy as much as possible. (check-in: [defd5205] user: drh branch: omit-rowid, size: 234177)
12:56
[ce164481] part of check-in [8f1709ff] Improved ORDER BY optimization for WITHOUT ROWID tables. (check-in: [8f1709ff] user: drh branch: omit-rowid, size: 234326)
12:05
[1df23d22] part of check-in [6055dad2] Disable the OR optimization for WITHOUT ROWID tables, since it relies on the use of rowids. (check-in: [6055dad2] user: drh branch: omit-rowid, size: 234161)
2013-10-31
17:38
[4e472e13] part of check-in [cff1f55c] Fix issues with quering from an auxiliary index that must refer back to the PRIMARY KEY index of a WITHOUT ROWID table. (check-in: [cff1f55c] user: drh branch: omit-rowid, size: 234112)
2013-10-28
22:39
[3dc37f79] part of check-in [9f8191d1] Merge recent fixes from trunk. (check-in: [9f8191d1] user: drh branch: omit-rowid, size: 233923)
22:33
[f18400f1] part of check-in [3a9e3ed9] Formatting improvements to the WHERE-clause constraint display in the wheretrace debugging logic. (check-in: [3a9e3ed9] user: drh branch: trunk, size: 233473)
20:15
[626e04be] part of check-in [9aac4e58] Do not use transitive WHERE-clause constraints on LEFT JOINs. Fix for ticket [c620261b5b5dc]. (check-in: [9aac4e58] user: drh branch: trunk, size: 233594)
19:59
[0490bd61] part of check-in [92ccd705] More wheretrace debugging support: Show a listing of all WHERE clause terms (on wheretrace bit 0x100) and include important flags such as TERM_VIRTUAL, WO_EQUIV, and EP_FromJoin. (check-in: [92ccd705] user: drh branch: trunk, size: 233499)
19:03
[65ff0a32] part of check-in [10f125f5] Bug fix and enhancements to the improved wheretrace logic that shows the constraint expressions. (check-in: [10f125f5] user: drh branch: trunk, size: 232443)
14:34
[8eaf13f3] part of check-in [710a18ac] Improved "wheretrace" capabilities: Show the constraint expression if the wheretrace flag has the 0x100 bit set and if compiled with SQLITE_ENABLE_TREE_EXPLAIN. (check-in: [710a18ac] user: drh branch: trunk, size: 232205)
2013-10-25
14:46
[512ddbf2] part of check-in [9eafafa3] Basic DELETE operations now working on WITHOUT ROWID tables. (check-in: [9eafafa3] user: drh branch: omit-rowid, size: 231949)
2013-10-24
14:16
[04217a95] part of check-in [0e56ba69] Delete PRIMARY KEY index entries last. Only construct the unique prefix of an index key when deleting entries from an index. (check-in: [0e56ba69] user: drh branch: omit-rowid, size: 231952)
00:18
[b5f5244d] part of check-in [d8bc8595] Correctly handle queries that use secondary indices of WITHOUT ROWID tables. (check-in: [d8bc8595] user: drh branch: omit-rowid, size: 231952)
2013-10-23
23:37
[3dcdb091] part of check-in [247f3899] Change the sqlite3OpenTable() utility to open the PRIMARY KEY index when reading a WITHOUT ROWID table. (check-in: [247f3899] user: drh branch: omit-rowid, size: 231406)
22:23
[13add0a8] part of check-in [2c028ddc] Construct secondary indices on WITHOUT ROWID tables. (check-in: [2c028ddc] user: drh branch: omit-rowid, size: 231388)
01:57
[f9e76627] part of check-in [3f8016de] Some simple inserts and queries working on WITHOUT ROWID tables. (check-in: [3f8016de] user: drh branch: omit-rowid, size: 231396)
2013-10-22
18:01
[32b6e99b] part of check-in [a106ce86] The Index object now has nKeyCol and nColumn. nColumn is the total number of columns and nKeyCol is the number of key columns. Currently these always differ by one. Refactor aiColumn[] to be of type i16 instead of int. (check-in: [a106ce86] user: drh branch: omit-rowid, size: 231152)
14:28
[a5253015] part of check-in [45efc94f] Add a procedure to handle the messy details of allocating an Index object from the heap. (check-in: [45efc94f] user: drh branch: omit-rowid, size: 231163)
2013-10-11
15:05
[dd2d0d69] part of check-in [7df06684] Fix various harmless compiler warnings. Change the "warnings.sh" script to work with STAT4 instead of STAT3. (check-in: [7df06684] user: drh branch: trunk, size: 231499)
2013-10-08
20:42
[8dd4cb20] part of check-in [65553ff3] Rollback some of the previous changes in the branch such that the estimated row sizes are now only used as a tie-breaker for index scans. (check-in: [65553ff3] user: drh branch: row-size-est, size: 231473)
18:40
[2a04ab58] part of check-in [18bd6ba9] Further refinement of the idea of multiplying run-time cost estimates by the estimated row size. (check-in: [18bd6ba9] user: drh branch: row-size-est, size: 231814)
2013-10-07
17:32
[ad5e680c] part of check-in [cb34cfe5] Multiply all cursor step cost estimates by the estimated size of the row in bytes, in order to get the query planner ot make use of estimated row sizes. This check-in uses magic numbers in a few places (for example, estimates of the size of output rows) and needs lots of refinement. Consider this a proof-of-concept only. (check-in: [cb34cfe5] user: drh branch: row-size-est, size: 231369)
16:53
[7916e32a] part of check-in [8e78557a] Try to remember statistics from ANALYZE using LogEst instead of u64. (check-in: [8e78557a] user: drh branch: log-stats, size: 231370)
2013-10-05
19:18
[72c6c205] part of check-in [8b4aa0c7] Completely remove the iScanRatio field. The PRAGMA index_list(TABLE) command shows the estimated row size in the forth column. It also generates a row for the table with an index name of NULL. The query planner still does not take row size estimates into account - that is the next step. (check-in: [8b4aa0c7] user: drh branch: row-size-est, size: 231167)
18:16
[7b98d09e] part of check-in [66c4a251] Begin an experimental refactoring to estimate the average number of bytes in table and index rows and to use that information in query planner. Begin by renaming WhereCost to LogEst and making that type and its conversion routines available outside of where.c. (check-in: [66c4a251] user: drh branch: row-size-est, size: 231210)
2013-10-04
02:36
[903e295f] part of check-in [6c352edb] Progress toward using the iScanRatio information on indices. Many tests are still failing. (check-in: [6c352edb] user: drh branch: index-scan-rate, size: 234264)
2013-09-30
19:33
[d8c2c5ff] part of check-in [9c9fa151] Fix a minor typo in a comment in where.c. (check-in: [9c9fa151] user: drh branch: trunk, size: 234627)
2013-09-12
17:29
[d2f58a44] part of check-in [4c84d1b4] Merge in the Expr.flags expansion to 32-bits. Use an extra bit to help optimize the sqlite3ExprSkipCollate() routine. (check-in: [4c84d1b4] user: drh branch: unlikely-func, size: 234628)
2013-09-11
17:39
[47a9d554] part of check-in [6e6bded0] Improvements to likelihood processing so that commuting an unindexed term in the WHERE clause does not change the query plan. (check-in: [6e6bded0] user: drh branch: unlikely-func, size: 234627)
14:34
[74beca71] part of check-in [5d00cce7] Additional unlikely() test cases. Logic tweaks to support test coverage. (check-in: [5d00cce7] user: drh branch: unlikely-func, size: 234683)
03:53
[6b9e2bc4] part of check-in [52d52688] Tweaks to the index selection logic. (check-in: [52d52688] user: drh branch: unlikely-func, size: 234675)
2013-09-10
01:53
[05cf3150] part of check-in [a51d7515] Merge trunk fixes into the unlikely-func branch. (check-in: [a51d7515] user: drh branch: unlikely-func, size: 234588)
2013-09-09
19:37
[b5d59b89] part of check-in [d6e361d7] Make sure that the transitive constraint optimization does not cause WHERE clause terms to be disabled prematurely. We are unable to find a test case that fails because of this, but it seems prudent to make this preventative change nevertheless. (check-in: [d6e361d7] user: drh branch: trunk, size: 232424)
2013-09-07
00:29
[613cfc35] part of check-in [b65dc534] Continuing refinements of the logic to take WHERE clause terms not used for indexing into account when computing the number of output rows from each table. (check-in: [b65dc534] user: drh branch: unlikely-func, size: 234487)
2013-09-06
17:45
[ce16c689] part of check-in [1a46a724] Enhance the plan solver to take into account the number of output rows when computing the set of paths to retain for the next cycle. (check-in: [1a46a724] user: drh branch: unlikely-func, size: 234283)
15:23
[c9f8ae51] part of check-in [036fc37a] Initial implementation of the unlikely() SQL function used as a hint to the query planner. (check-in: [036fc37a] user: drh branch: unlikely-func, size: 233765)
00:40
[06c249a5] part of check-in [a99a53b8] Make sure the destination WhereLoop is left in a sane state when an OOM fault occurs inside of whereLoopXfer(). (check-in: [a99a53b8] user: drh branch: trunk, size: 232323)
2013-09-04
18:14
[613993bd] part of check-in [8462fb43] Rearrange the order of conditions in an "if" statement to facilitate testing. (check-in: [8462fb43] user: drh branch: trunk, size: 232274)
04:04
[95a351c9] part of check-in [8df95bb0] Fix out-of-order variable declaration. Fix harmless compiler warning. (check-in: [8df95bb0] user: mistachkin branch: trunk, size: 232273)
2013-09-03
19:26
[1fe091c6] part of check-in [91d2cfbc] Harden the STAT4 logic in where.c against OOM faults. (check-in: [91d2cfbc] user: drh branch: trunk, size: 232273)
14:33
[51f55344] part of check-in [cce54186] Make sure the omit-noop-left-join optimization is not applied if columns of the LEFT JOIN are used in the ORDER BY clause. Ticket [be84e357c035]. Increase version number to 3.8.0.2. (check-in: [cce54186] user: drh branch: branch-3.8.0, size: 231445)
14:03
[99477e9d] part of check-in [0303d6bc] Make sure the omit-noop-left-join optimization is not applied if columns of the LEFT JOIN are used in the ORDER BY clause. Ticket [be84e357c035] (check-in: [0303d6bc] user: drh branch: trunk, size: 232173)
2013-09-02
20:22
[573a815c] part of check-in [f7079b53] Simplify branch coverage testing by interchanging the order of two tests in the whereLoopInsert() function. (check-in: [f7079b53] user: drh branch: trunk, size: 232163)
07:16
[a37169b4] part of check-in [c21f58d8] Fix a problem with using stat4 data to estimate the number of rows scanned by a range constraint on the second or subsequent column of any index where an affinity transformation must be applied to the constraint argument. (check-in: [c21f58d8] user: dan branch: trunk, size: 232163)
2013-08-30
17:50
[83f6106e] part of check-in [1e0b77cf] Fix comment typos in the where.c module. No code changes. (check-in: [1e0b77cf] user: drh branch: trunk, size: 232074)
17:35
[97fc542b] part of check-in [79e458ef] If the cost of two whereLoop objects is the same in every way except that one has fewer expected output rows than the other, then choose the one with fewer output rows. (check-in: [79e458ef] user: drh branch: trunk, size: 232070)
2013-08-29
14:56
[cad6497f] part of check-in [d4b6ad33] Restore fix [f15591f802], which was accidentally clobbered by the stat4 merge. (check-in: [d4b6ad33] user: dan branch: trunk, size: 231932)
13:21
[a9ec7cab] part of check-in [cb667449] In the query optimizer, when converting BETWEEN and LIKE/GLOB expressions into simpler forms for processing, be sure to transfer the LEFT JOIN markings. Fix for ticket [bc878246eafe0f52c]. Cherrypick of [caab361ebe]. (check-in: [cb667449] user: drh branch: branch-3.8.0, size: 231435)
13:15
[53ac2441] part of check-in [c3f75941] Cherrypick of [c1152bdcbb] and fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns. (check-in: [c3f75941] user: drh branch: branch-3.8.0, size: 231276)
10:46
[dab4d4b8] part of check-in [c1152bdc] Candidate fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns. (check-in: [c1152bdc] user: dan branch: trunk, size: 231915)
2013-08-28
18:18
[e0b70ec7] part of check-in [12d0a885] Add the win32-longpath VFS allowing windows filenames up to 32K characters in length. Remove unused code when -DSQLITE_MAX_MMAP_SIZE=0. Fix some compiler warnings on windows. (check-in: [12d0a885] user: drh branch: trunk, size: 231799)
16:27
[6a82cd9e] part of check-in [caab361e] In the query optimizer, when converting BETWEEN and LIKE/GLOB expressions into simpler forms for processing, be sure to transfer the LEFT JOIN markings. Fix for ticket [bc878246eafe0f52c]. (check-in: [caab361e] user: drh branch: trunk, size: 231794)
01:54
[ee148dd5] part of check-in [8917e9f9] Fix several harmless compiler warnings. Fix a couple compiler issues with the shell. (check-in: [8917e9f9] user: mistachkin branch: mmapDisabled, size: 231165)
2013-08-27
23:15
[289bfa23] part of check-in [67a9a392] Adjust ANALYZE for improved test coverage. Use the SQLITE_ENABLE_STAT3_OR_STAT4 macro (created in sqliteInt.h) to conditionally include code, instead of a boolean specifying both macros separately. (check-in: [67a9a392] user: drh branch: trunk, size: 231635)
2013-08-26
23:18
[18cd1516] part of check-in [a32af0ab] Merge the STAT4 capability into trunk. (check-in: [a32af0ab] user: drh branch: trunk, size: 231935)
2013-08-23
17:33
[6e718c39] part of check-in [ed310201] Adjust #ifdefs to get SQLITE_OMIT_AUTOMATIC_INDEX and SQLITE_OMIT_PAGER_PRAGMAS to build. (check-in: [ed310201] user: drh branch: trunk, size: 231160)
2013-08-22
02:56
[8596edcf] part of check-in [0775501a] Defer the creation of automatic indices until the index is actually used. (check-in: [0775501a] user: drh branch: trunk, size: 231083)
2013-08-20
17:14
[0ced8882] part of check-in [ef192abb] Fix an invalid assert() in where.c. Also a crash that can occur in the EXPLAIN QUERY PLAN code under obscure circumstances. (check-in: [ef192abb] user: dan branch: trunk, size: 230874)
17:00
[1a020a02] part of check-in [e476408e] Ignore IS NOT NULL and NOT NULL constraints on NOT NULL columns. (check-in: [e476408e] user: drh branch: trunk, size: 230813)
2013-08-19
19:29
[03a50ecb] part of check-in [d6c4d48a] Initialize a variable in fts3_write.c on the grounds that the argument required to show that it does not require initialization with is complicated. Add an assert() to where.c to silence a clang scan-build warning. (check-in: [d6c4d48a] user: dan branch: trunk, size: 230813)
14:19
[be91b3d1] part of check-in [f15591f8] Fix a potential reference off the end of an array in the query planner. (check-in: [f15591f8] user: drh branch: trunk, size: 230793)
11:15
[67a823e7] part of check-in [a0d9ca4f] Fixes for harmless compiler warnings. (check-in: [a0d9ca4f] user: drh branch: trunk, size: 230772)
2013-08-16
14:49
[9be69c42] part of check-in [dc1ccd09] Fix valueFromExpr() so that it returns SQLITE_NOMEM following an OOM when changing text encodings. Also fix some asserts to accommodate OOM errors. (check-in: [dc1ccd09] user: drh branch: sqlite_stat4, size: 231534)
2013-08-12
20:14
[d97b5cb2] part of check-in [cca8bf43] If ENABLE_STAT3 is defined but ENABLE_STAT4 is not, have ANALYZE create and populate the sqlite_stat3 table instead of sqlite_stat4. (check-in: [cca8bf43] user: dan branch: sqlite_stat4, size: 231423)
09:29
[c1090a27] part of check-in [088d1ff9] Fix minor problems caused by adding the rowid to the records in stat4. (check-in: [088d1ff9] user: dan branch: sqlite_stat4, size: 230917)
2013-08-10
19:08
[adf47614] part of check-in [3a5e8ab7] Add the rowid field to the end of sample records stored in the sqlite_stat4 table. (check-in: [3a5e8ab7] user: dan branch: sqlite_stat4, size: 230890)
2013-08-08
19:38
[0e058c33] part of check-in [9228aaf5] Fix problems in estimating the number of rows visited by a range query using sqlite_stat4 data when the column subject to the range query is not the leftmost of the index. (check-in: [9228aaf5] user: dan branch: sqlite_stat4, size: 230770)
16:17
[2323663d] part of check-in [e50dc305] Use a binary search instead of a linear scan when comparing a sample key against data from the sqlite_stat4 table. (check-in: [e50dc305] user: dan branch: sqlite_stat4, size: 229238)
12:21
[a1429454] part of check-in [9fec3e38] Fix a segfault in "ALTER TABLE t1 ADD COLUMN b DEFAULT (-+1)". Also an assert() failure that could occur if SQLITE_ENABLE_STAT4 were not defined. (check-in: [9fec3e38] user: dan branch: sqlite_stat4, size: 228176)
11:48
[5ea698bd] part of check-in [f783938e] Fix a bug in using stat4 data to estimate the number of rows selected by a range constraint. (check-in: [f783938e] user: dan branch: sqlite_stat4, size: 228099)
2013-08-07
19:46
[c973297f] part of check-in [7b70b419] Replace variable Index.avgEq (average number of rows in keys for which there is no sample in sqlite_stat4) with vector Index.aAvgEq. (check-in: [7b70b419] user: dan branch: sqlite_stat4, size: 228464)
18:42
[0051a364] part of check-in [08f74c45] Merge latest trunk changes with this branch. (check-in: [08f74c45] user: dan branch: sqlite_stat4, size: 228354)
15:52
[4e188dc4] part of check-in [353950a5] When estimating the number of rows scanned using data from the sqlite_stat4 table, avoid allocating UnpackedRecord and KeyInfo structures until they are definitely required. (check-in: [353950a5] user: dan branch: sqlite_stat4, size: 228356)
01:18
[ea01a52e] part of check-in [f8d8790e] Fix typos and add clarification to comments in where.c. No code changes. (check-in: [f8d8790e] user: drh branch: trunk, size: 230738)
2013-08-06
20:15
[14252578] part of check-in [84999e27] Fixes for builds without SQLITE_ENABLE_STAT4. (check-in: [84999e27] user: dan branch: sqlite_stat4, size: 228582)
20:01
[37c3dc9e] part of check-in [2973f5ca] When possible, use the multi-column samples in sqlite_stat4 to estimate the number of index rows scanned by a query plan. (check-in: [2973f5ca] user: dan branch: sqlite_stat4, size: 228539)
2013-08-03
20:24
[072abd85] part of check-in [2beea303] Begin adding experimental sqlite_stat4 table. This commit is buggy. (check-in: [2beea303] user: dan branch: sqlite_stat4, size: 228227)
2013-08-02
23:40
[67245bb7] part of check-in [21302076] Updates to requirements marks. No code changes. (check-in: [21302076] user: drh branch: trunk, size: 230740)
16:41
[30a9f5e4] part of check-in [478113f1] Add support for partial indices. (check-in: [478113f1] user: drh branch: trunk, size: 231742)
2013-08-01
17:21
[38264830] part of check-in [127a5b77] An improved method for avoiding the use of the STAT3 samples to compute the estimated number of outputs when the left-most index is equality constrained. This check-in undoes the previous fix and applies a new one. (check-in: [127a5b77] user: drh branch: trunk, size: 231087)
16:52
[fe1d056f] part of check-in [31b4e63b] Avoid using left-most column STAT3 samples if the left-most column has an equality constrain and there are inequality constraints on the second column. (check-in: [31b4e63b] user: drh branch: trunk, size: 231070)
15:09
[5642a0f1] part of check-in [0c8cfdfa] More test cases and corresponding bug fixes. (check-in: [0c8cfdfa] user: drh branch: partial-indices, size: 231709)
12:21
[bad23a54] part of check-in [81834c30] Refactor internal function name sqlite3VdbeGetValue() to sqlite3VdbeGetBoundValue(). (check-in: [81834c30] user: drh branch: partial-indices, size: 231683)
01:14
[14d48fe7] part of check-in [fb9044d1] Add the logic to keep partial indices up to date through DML statements and when new partial indices are created. This new logic is untested except to verify that it does not interfere with full indices. (check-in: [fb9044d1] user: drh branch: partial-indices, size: 231673)
2013-07-31
23:22
[afa33842] part of check-in [8ca3eac1] Add logic to the query planner to only use partial indices if the WHERE clause constrains the search to rows covered by the partial index. This is just infrastructure. The key routine, sqlite3ExprImpliesExpr(), is currently a no-op so that partial indices will never be used. (check-in: [8ca3eac1] user: drh branch: partial-indices, size: 231670)
2013-07-30
15:10
[a55e2747] part of check-in [eb6d4278] Reduce the size of the stack required by the codeOneLoopStart() function in where.c. (check-in: [eb6d4278] user: drh branch: trunk, size: 231054)
2013-07-18
14:50
[1a26c37b] part of check-in [5dcffa67] Fix a 8-byte alignment problem in the query planner that might cause problems on sparc when compiled with -m32. (check-in: [5dcffa67] user: drh branch: trunk, size: 230928)
2013-07-16
21:31
[927acb79] part of check-in [5e19d054] Enhance the query planner so that it looks at multiple solutions to OR expressions in the WHERE clause. (check-in: [5e19d054] user: drh branch: trunk, size: 230875)
2013-07-09
03:04
[f5201334] part of check-in [52a49cbc] Make sure the schema is verified prior to processing a "WHERE 0" on the first term of a compound SELECT statement. Fix for ticket [490a4b723562429] (check-in: [52a49cbc] user: drh branch: trunk, size: 229011)
2013-07-08
21:12
[cd7ef913] part of check-in [3b30b75b] Fix an adverse interaction between the IS NOT NULL optimization (available only with SQLITE_ENABLE_STAT3) and the transitive constraint processing. Fix for ticket [d805526eae253] (check-in: [3b30b75b] user: drh branch: trunk, size: 229011)
2013-07-05
11:10
[7867ef5b] part of check-in [5c906e91] Add missing "static" qualifier to functions in where.c. (check-in: [5c906e91] user: dan branch: trunk, size: 228659)
2013-07-02
15:25
[987eaefc] part of check-in [91bc840e] Remove a surplus local variable (check-in: [91bc840e] user: drh branch: trunk, size: 228645)
10:06
[8fc6dc55] part of check-in [4a9d51e7] Fix a minor typo in a comment in where.c. (check-in: [4a9d51e7] user: dan branch: trunk, size: 228667)
2013-07-01
17:27
[b546b95b] part of check-in [72919ec3] Add a missing test that prevented double LEFT JOINs with transitive constraints from working correctly. Fix for ticket [868145d012]. (check-in: [72919ec3] user: drh branch: trunk, size: 228669)
11:05
[3ea606b1] part of check-in [0d68d4d0] Further minor comment corrections and enhancements in where.c. (check-in: [0d68d4d0] user: drh branch: trunk, size: 228631)
10:38
[789d3193] part of check-in [0ffaab3b] Make a trivial comment fix in where.c. (check-in: [0ffaab3b] user: drh branch: trunk, size: 228051)
2013-06-28
23:55
[2c447e37] part of check-in [338826ef] Issue the new SQLITE_WARNING_AUTOINDEX warning on the SQLite log whenever an automatic index is created. (check-in: [338826ef] user: drh branch: trunk, size: 228078)
21:12
[b0cdc92a] part of check-in [459b3179] Add the SQLITE_DEFAULT_AUTOMATIC_INDEX compile-time option, which if set to zero turns automatic indices off by default. Increase the estimated cost of an automatic index. Additional minor refactoring of the automatic index code. (check-in: [459b3179] user: drh branch: trunk, size: 227807)
17:29
[e110b9ef] part of check-in [60c19b86] Add a bit to the SQLITE_TESTCTRL_OPTIMIZATIONS option for sqlite3_file_control() that will disable the use of SQLITE_STAT3 information in the query planner. (check-in: [60c19b86] user: drh branch: trunk, size: 227607)
13:43
[69c39db2] part of check-in [5480d124] Fix an issue with the OmitNoopJoin optimization and add test cases that are specifically for that optimization. (check-in: [5480d124] user: drh branch: trunk, size: 227467)
2013-06-22
15:44
[9bcfcb4e] part of check-in [d929df9b] Add the ability to disable the omit-join-table optimization for testing purposes. (check-in: [d929df9b] user: drh branch: omit-join-table-opt, size: 227157)
2013-06-21
02:15
[0ca9544c] part of check-in [d7a25cc7] Only eliminate inner loops of a JOIN if they are the RHS of a LEFT JOIN and if they give no more than a single result. This appears to give correct answers in all cases. (check-in: [d7a25cc7] user: drh branch: omit-join-table-opt, size: 227101)
02:05
[fc5293b5] part of check-in [ca839723] Attempt to disable inner loops of a join that do not generate output. This does not work, since the inner loops might run zero times and thus inhibit all output. Needs to be enhanced to work only for LEFT JOINs or when we know that the inner loop will always run at least once. (check-in: [ca839723] user: drh branch: omit-join-table-opt, size: 227041)
00:35
[c950b131] part of check-in [2c2577e6] Modify the query planner interface so that it always passes in the result set. This is the first step toward adding an optimization that will omit tables from a join that do not contribute to the result. (check-in: [2c2577e6] user: drh branch: omit-join-table-opt, size: 226336)
2013-06-20
17:32
[8d6c07d9] part of check-in [604c3c5d] Add a NEVER() macro and an explanation comment around an unreachable branch in the STAT3 logic. (check-in: [604c3c5d] user: drh branch: nextgen-query-plan-exp, size: 226199)
2013-06-19
18:01
[ac9f8c4e] part of check-in [d97898e8] Add in the cost of doing a table lookup on OR searches. Make test case changes to deal with difference in STAT3 behavior. (check-in: [d97898e8] user: drh branch: nextgen-query-plan-exp, size: 226032)
13:59
[88884f3a] part of check-in [8d2ae8e2] Additional compiler warning fixes. (check-in: [8d2ae8e2] user: drh branch: nextgen-query-plan-exp, size: 225952)
13:32
[0d12d709] part of check-in [9d3ef3bd] Fix a harmless uninitialized variable warning. (check-in: [9d3ef3bd] user: drh branch: nextgen-query-plan-exp, size: 225996)
12:34
[e5ecc3d1] part of check-in [8f27f35f] Simplify and add invariants to the WhereLoop merging logic inside of whereLoopInsert(). (check-in: [8f27f35f] user: drh branch: nextgen-query-plan-exp, size: 225996)
03:27
[5cc059bd] part of check-in [10021941] Fix compiler warnings. Fix a harmless off-by-one error in the solver. (check-in: [10021941] user: drh branch: nextgen-query-plan-exp, size: 225863)
2013-06-18
20:06
[85b7b80a] part of check-in [4fbb0c4d] Adjustments to testcase() macros for improved testability. (check-in: [4fbb0c4d] user: drh branch: nextgen-query-plan-exp, size: 225525)
01:52
[86cc9705] part of check-in [4c6d58d7] Remove some redundant and unreachable code. (check-in: [4c6d58d7] user: drh branch: nextgen-query-plan-exp, size: 225543)
2013-06-17
21:37
[b911a484] part of check-in [b61402af] Add more testcase() macros. Fix a memory leak following OOM in the virtual table analysis logic. (check-in: [b61402af] user: drh branch: nextgen-query-plan-exp, size: 225636)
18:20
[74627cb9] part of check-in [eaf1f1b4] Simplifications to the NGQP. Add the queryplantest makefile target. Add testcase() macros in the NGQP. (check-in: [eaf1f1b4] user: drh branch: nextgen-query-plan-exp, size: 223866)
14:18
[74ecd744] part of check-in [e8f12428] Use automatic indices on subqueries of the FROM clause when appropriate. (check-in: [e8f12428] user: drh branch: nextgen-query-plan-exp, size: 224590)
2013-06-15
15:11
[df0d274f] part of check-in [3e8ac469] Fix compiler warnings. (check-in: [3e8ac469] user: drh branch: nextgen-query-plan-exp, size: 224624)
2013-06-14
13:27
[cd2ee239] part of check-in [cecc5fdd] Comment tweaks in where.c. No changes to code. (check-in: [cecc5fdd] user: drh branch: nextgen-query-plan-exp, size: 224872)
02:51
[7d406cca] part of check-in [b920bb70] Add a new ORDER BY optimization that bypasses ORDER BY terms that are constrained by == and IS NULL terms of the WHERE clause. (check-in: [b920bb70] user: drh branch: nextgen-query-plan-exp, size: 224984)
2013-06-13
17:58
[ba5f6766] part of check-in [ade473b5] An index might be useful for ORDER BY if any indexed column is in the ORDER BY clause, not just the first indexed column. (check-in: [ade473b5] user: drh branch: nextgen-query-plan-exp, size: 223776)
17:28
[700085a8] part of check-in [e8b7ea82] Make sure that disabling the covering index scan optimization does not prevent a covering index from being used to satisfy an ORDER BY clause. (check-in: [e8b7ea82] user: drh branch: nextgen-query-plan-exp, size: 223761)
15:50
[82b519b7] part of check-in [459a7b90] Restore the ability to do a BETWEEN query on the rowid. Also fix a nearby comment. (check-in: [459a7b90] user: drh branch: nextgen-query-plan-exp, size: 223716)
15:16
[2e8e0a18] part of check-in [3a72af2a] Make the MIN() and MAX() macros available in sqliteInt.h. Add TUNING comments to the NGQP and adjust costs slightly. (check-in: [3a72af2a] user: drh branch: nextgen-query-plan-exp, size: 223719)
14:51
[c6944d98] part of check-in [b5ca80d9] Fix an off-by-one error in the WhereCost to integer conversion. (check-in: [b5ca80d9] user: drh branch: nextgen-query-plan-exp, size: 221352)
2013-06-12
20:18
[42098511] part of check-in [e120c558] Activate the one-pass optimization. Update comments, especially the descriptions of the various objects. (check-in: [e120c558] user: drh branch: nextgen-query-plan-exp, size: 221353)
17:55
[568aef75] part of check-in [25c0f729] Bug fixes in the handling of virtual tables. (check-in: [25c0f729] user: drh branch: nextgen-query-plan-exp, size: 220042)
17:17
[97f5d9c3] part of check-in [f2e15b19] Merge all changes from trunk. (check-in: [f2e15b19] user: drh branch: nextgen-query-plan-exp, size: 219994)
17:08
[58522e12] part of check-in [addd7f46] "make test" now passing. (check-in: [addd7f46] user: drh branch: nextgen-query-plan-exp, size: 220118)
14:52
[67d70ce7] part of check-in [25e2cde1] Add the "queryplanner" test permutation. Continuing refinements to NGQP. (check-in: [25e2cde1] user: drh branch: nextgen-query-plan-exp, size: 219900)
03:48
[3f38f769] part of check-in [40567fdd] Continue refining the NGQP (check-in: [40567fdd] user: drh branch: nextgen-query-plan-exp, size: 219922)
2013-06-11
18:59
[2afa8f1a] part of check-in [ba897100] Improved processing of DISTINCT. (check-in: [ba897100] user: drh branch: nextgen-query-plan-exp, size: 219963)
13:30
[57235724] part of check-in [f1cac24f] Fix the Parse.nQueryLoop state variable to work with NGQP. (check-in: [f1cac24f] user: drh branch: nextgen-query-plan-exp, size: 218756)
02:32
[1241512f] part of check-in [36373b85] Fixes to EXPLAIN QUERY PLAN output. Change weights back to something closer to what they are in legacy. More test case fixes. (check-in: [36373b85] user: drh branch: nextgen-query-plan-logcost, size: 218663)
01:50
[72f9aa6c] part of check-in [e612664a] Handle virtual tables correctly when using logarithmic costs. Fixes to test cases. (check-in: [e612664a] user: drh branch: nextgen-query-plan-logcost, size: 218645)
2013-06-10
23:30
[672b76db] part of check-in [aa580e36] Fix test cases for the new EXPLAIN QUERY PLAN format. Add the wherecosttest tool. Other fixes to logarithm cost. (check-in: [aa580e36] user: drh branch: nextgen-query-plan-logcost, size: 217892)
20:46
[402d3f74] part of check-in [69cf8772] Fix some minor issues with logarithmic cost in NGQP. (check-in: [69cf8772] user: drh branch: nextgen-query-plan-logcost, size: 217789)
19:12
[ae52899c] part of check-in [9e810967] First attempt to store costs and row counts as a logarithm. (check-in: [9e810967] user: drh branch: nextgen-query-plan-logcost, size: 217247)
14:56
[2e75418e] part of check-in [0f8a38ee] Simplification and performance tweak to the high-speed NGQP bypass. (check-in: [0f8a38ee] user: drh branch: nextgen-query-plan-exp, size: 216117)
12:34
[eddcadac] part of check-in [aae14350] Performance improvements for whereScan methods. (check-in: [aae14350] user: drh branch: nextgen-query-plan-exp, size: 216215)
12:15
[9fff9a5f] part of check-in [20eeccf1] Minor problems in the high-speed NGQP fixed. (check-in: [20eeccf1] user: drh branch: nextgen-query-plan-fast, size: 216329)
2013-06-09
17:21
[2dae18fe] part of check-in [db2415fa] High-speed version of NGQP. Still has some minor problems. (check-in: [db2415fa] user: drh branch: nextgen-query-plan-fast, size: 215856)
2013-06-07
02:04
[70e1ebd1] part of check-in [dfbca3ac] Must faster computation of estimated logarithm. (check-in: [dfbca3ac] user: drh branch: nextgen-query-plan-exp, size: 213546)
00:29
[bbd8aad0] part of check-in [02741d17] Further prepare-time performance improvements. (check-in: [02741d17] user: drh branch: nextgen-query-plan-exp, size: 213448)
2013-06-06
23:44
[fb4bee9b] part of check-in [9f8e84ab] Performance improvements. (check-in: [9f8e84ab] user: drh branch: nextgen-query-plan-exp, size: 213746)
23:02
[e029cd3f] part of check-in [d4141ecb] Improved management of the space to hold WhereLoop.aLTerm[]. (check-in: [d4141ecb] user: drh branch: nextgen-query-plan-exp, size: 213849)
19:25
[0b652e42] part of check-in [b4a5dbad] Remove some commented-out code that was mistakenly left in the previous check-in. (check-in: [b4a5dbad] user: drh branch: nextgen-query-plan-exp, size: 211587)
19:16
[e3b7d7ef] part of check-in [bfc76ae1] Clean up and reorganize the elements of the various objects in the analysis tree for the NGQP. (check-in: [bfc76ae1] user: drh branch: nextgen-query-plan-exp, size: 211743)
2013-06-05
23:39
[83c6fce3] part of check-in [1574653b] Move the definitions of the WhereLevel and WhereInfo objects out of sqliteInt.h and into where.c. This will facilitate future refactoring of the internal query planner data structures. (check-in: [1574653b] user: drh branch: nextgen-query-plan-exp, size: 211975)
17:53
[35e510bf] part of check-in [9b1c4954] Performance improvement for the OR-clause analysis in the NGQP. (check-in: [9b1c4954] user: drh branch: nextgen-query-plan-exp, size: 206968)
16:19
[7d8a020b] part of check-in [cbef38c2] Minor performance tuning of the NGQP. (check-in: [cbef38c2] user: drh branch: nextgen-query-plan-exp, size: 206895)
12:47
[3b175d73] part of check-in [1c4a7880] Performance tweak to whereLoopInsert(). (check-in: [1c4a7880] user: drh branch: nextgen-query-plan-exp, size: 206741)
2013-06-04
23:40
[0b8fd61d] part of check-in [cf96eb59] Update some variable names and comments in the ORDER BY optimizer. Fix a bug in the ORDER BY optimizer dealing with IS NULL constraints. Updates to test cases. (check-in: [cf96eb59] user: drh branch: nextgen-query-plan-exp, size: 206670)
18:27
[cc1e1a72] part of check-in [f49cd6c4] Restore the PRAGMA reverse_unordered_selects behavior. (check-in: [f49cd6c4] user: drh branch: nextgen-query-plan-exp, size: 206007)
18:03
[e46c09e1] part of check-in [774d5ff8] Get the index-only optimization working for OR queries. (check-in: [774d5ff8] user: drh branch: nextgen-query-plan-exp, size: 205922)
13:37
[07d74148] part of check-in [63fd025a] Better determination of when an index is UNIQUE. (check-in: [63fd025a] user: drh branch: nextgen-query-plan-exp, size: 205919)
12:58
[89e9e018] part of check-in [ff2fa407] Fix a display issue with EXPLAIN QUERY PLAN. (check-in: [ff2fa407] user: drh branch: nextgen-query-plan-exp, size: 205921)
12:42
[cca3284b] part of check-in [e605c468] Refactor the ORDER BY optimizer in the NGQP so that it is easier to maintain and so that it can support optimizing out GROUP BY and DISTINCT clauses. (check-in: [e605c468] user: drh branch: nextgen-query-plan-exp, size: 205838)
2013-06-03
20:46
[0082ef59] part of check-in [6bc71dfc] Pull in recent trunk changes. Fix the ORDER BY optimizer so that it is better able to deal with COLLATE clauses. Clean up ambiguities in the descidx1.test script. (check-in: [6bc71dfc] user: drh branch: nextgen-query-plan-exp, size: 202530)
19:17
[6226d991] part of check-in [fabb2185] Do not use an index fullscan for an UPDATE or DELETE or if disabled by sqlite3_test_control() or sqlite3_config(). (check-in: [fabb2185] user: drh branch: nextgen-query-plan-exp, size: 202506)
17:35
[a60b2729] part of check-in [ff134e6e] Update the NGQP to make use of STAT3 information if it is available. (check-in: [ff134e6e] user: drh branch: nextgen-query-plan-exp, size: 202317)
16:56
[82c6fd16] part of check-in [aaf7f589] Honor the orderByConsumed boolean returned from virtual table query planner. (check-in: [aaf7f589] user: drh branch: nextgen-query-plan-exp, size: 201428)
16:03
[b8a41bcd] part of check-in [62d38240] Fix to the logic that disables constraints on virtual tables. (check-in: [62d38240] user: drh branch: nextgen-query-plan-exp, size: 201360)
15:34
[078c3aea] part of check-in [02984012] Fix an issue that was causing ORDER BY DESC to come out in ascending order. (check-in: [02984012] user: drh branch: nextgen-query-plan-exp, size: 201356)
15:07
[7e34bb26] part of check-in [510f4d8e] Set the WHERE_UNIQUE flag on loops that can only run once. (check-in: [510f4d8e] user: drh branch: nextgen-query-plan-exp, size: 201305)
2013-05-31
20:43
[7c931bf9] part of check-in [42511a7e] The NGQP might not find a solution if INDEXED BY constraints on the query are set wrong. If that is the case, print a "no query solution" error and abort before trying to use the non-existant solution. (check-in: [42511a7e] user: drh branch: nextgen-query-plan-exp, size: 201129)
20:28
[3e4ca21a] part of check-in [723f901a] Do not search using ON clause constraints of LEFT JOINs to the right of the table. (check-in: [723f901a] user: drh branch: nextgen-query-plan-exp, size: 201100)
20:00
[3d93b77c] part of check-in [433d1aec] Make sure a unique cursor number is allocated for automatic indices. (check-in: [433d1aec] user: drh branch: nextgen-query-plan-exp, size: 200986)
19:14
[0c1d6feb] part of check-in [665e4291] Do not attempt to generate code in the NGQP if there have been prior errors, since with prior errors some of the expressions might not be fully named resolved. (check-in: [665e4291] user: drh branch: nextgen-query-plan-exp, size: 200950)
18:20
[a8bb7f25] part of check-in [0b1bee92] Fix a problem with code generation on LEFT JOIN of tables without an index. (check-in: [0b1bee92] user: drh branch: nextgen-query-plan-exp, size: 200830)
18:13
[e6d80ad3] part of check-in [2f2ce416] Another virtual table fix in NGQP. (check-in: [2f2ce416] user: drh branch: nextgen-query-plan-exp, size: 200818)
17:55
[103ccfa8] part of check-in [23af28e2] Fix problems in the virtual table logic for NGQP. (check-in: [23af28e2] user: drh branch: nextgen-query-plan-exp, size: 200818)
15:50
[586b6c36] part of check-in [816f8add] Remove the definitions of objects that are no longer used: WhereCost, WherePlan, and WhereBestIdx. (check-in: [816f8add] user: drh branch: nextgen-query-plan-exp, size: 200804)
15:18
[e120e28c] part of check-in [707f0323] Allow tracing of whereLoopInsert() when the 0x8 bit is set on ".wheretrace". Remove the use of sqlite_query_plan from where2.test. Fix a bug in the code generator for OR clause optimizations. (check-in: [707f0323] user: drh branch: nextgen-query-plan-exp, size: 202431)
13:36
[8e992281] part of check-in [d8efa5f8] Futher enhancements to the ORDER BY optimizer. (check-in: [d8efa5f8] user: drh branch: nextgen-query-plan-exp, size: 201721)
12:43
[0e1c4180] part of check-in [58805eb3] Improved detection of unnecessary ORDER BY clauses. (check-in: [58805eb3] user: drh branch: nextgen-query-plan-exp, size: 201549)
11:57
[530dd22d] part of check-in [5e1e6139] Fix the constructAutomaticIndex() routine so that it works with NGQP. (check-in: [5e1e6139] user: drh branch: nextgen-query-plan-exp, size: 200934)
2013-05-30
23:21
[38beadcf] part of check-in [24a2e9dd] Improvements to the ORDER BY suppressor in the NGQP. (check-in: [24a2e9dd] user: drh branch: nextgen-query-plan-exp, size: 200527)
22:27
[28e0cefe] part of check-in [a51d8c92] Incremental check-in with various NGQP fixes. Many tests still fail. (check-in: [a51d8c92] user: drh branch: nextgen-query-plan-exp, size: 200379)
19:29
[3e9b7b33] part of check-in [ae985db4] Futher simplifications to the NGQP. Fix some test cases to use EXPLAIN QUERY PLAN rather than the (now obsolete) sqlite_query_plan global variable. (check-in: [ae985db4] user: drh branch: nextgen-query-plan-exp, size: 199903)
17:43
[296baae1] part of check-in [001539df] Cut over the NGQP query planner. Remove lots of legacy code. This check-in compiles but does not work. The test suite gets incorrect answers and crashes. (check-in: [001539df] user: drh branch: nextgen-query-plan-exp, size: 202872)
2013-05-27
17:59
[3f4f25df] part of check-in [211f7a53] Update the NGQP to record which loops need be run in reverse order to satisfy ORDER BY clauses. (check-in: [211f7a53] user: drh branch: nextgen-query-plan-exp, size: 267404)
2013-05-24
14:52
[2fd11c00] part of check-in [b49fa745] Record in the WhereLoop object the set of virtual table constraints that need not be separately checked. (check-in: [b49fa745] user: drh branch: nextgen-query-plan-exp, size: 267296)
2013-05-22
20:49
[627bf1af] part of check-in [f783e8e6] Use the NGQP plan for EXPLAIN QUERY PLAN output. This change causes 207 errors in veryquick.test, many of which are benign. (check-in: [f783e8e6] user: drh branch: nextgen-query-plan-exp, size: 267069)
17:01
[3ca12d20] part of check-in [9bf0524d] Allow the rowid at the end of an index to be used in a constraint on that index. (check-in: [9bf0524d] user: drh branch: nextgen-query-plan-exp, size: 266744)
02:06
[b695db3f] part of check-in [12c709b4] Improvements to ORDER BY handling in the NGQP. Fix an "exit" mistakenly left in a test script during the previous check-in. (check-in: [12c709b4] user: drh branch: nextgen-query-plan-exp, size: 266575)
2013-05-21
19:23
[759c34be] part of check-in [04dfb85a] Enhanced "wheretrace" output in the NGQP solver routine. (check-in: [04dfb85a] user: drh branch: nextgen-query-plan-exp, size: 266227)
15:52
[a01d93b3] part of check-in [67367f1e] Work toward improving the NGQP's ability to optimize out ORDER BY clauses. (check-in: [67367f1e] user: drh branch: nextgen-query-plan-exp, size: 263827)
2013-05-14
15:31
[51d935c6] part of check-in [9fe20292] First attempt to get ORDER BY optimization working in NGQP. (check-in: [9fe20292] user: drh branch: nextgen-query-plan-exp, size: 261462)
2013-05-11
00:06
[049e7011] part of check-in [d6946f33] Minor fixes to the OR-clause processing in the NGQP. (check-in: [d6946f33] user: drh branch: nextgen-query-plan-exp, size: 257576)
2013-05-10
20:26
[374f50ce] part of check-in [e17003fc] Now generating OR-clause plans. (check-in: [e17003fc] user: drh branch: nextgen-query-plan-exp, size: 257454)
15:16
[f96b2602] part of check-in [586b55d8] Update the NGQP so that it can produce plans that include automatic indices. (check-in: [586b55d8] user: drh branch: nextgen-query-plan-exp, size: 254772)
03:30
[31160bac] part of check-in [0278e420] Factor out common operations into whereLoopAddAll(). Add stubs for missing features. (check-in: [0278e420] user: drh branch: nextgen-query-plan-exp, size: 252659)
02:11
[4816e3ec] part of check-in [5ed31c82] Merge in the latest trunk changes. (check-in: [5ed31c82] user: drh branch: nextgen-query-plan-exp, size: 253149)
02:00
[2be67c1a] part of check-in [82d50e19] Free up bits of wsFlags for reuse. Install the ORDER BY optimization infrastructure for the NGQP. (check-in: [82d50e19] user: drh branch: nextgen-query-plan-exp, size: 252910)
2013-05-09
14:20
[5c4cbc1e] part of check-in [1128575d] Do not move WHERE clause terms inside OR expressions that are contained within an ON clause of a LEFT JOIN. Fix for ticket [f2369304e47167e3e]. (check-in: [1128575d] user: drh branch: trunk, size: 222053)
2013-05-08
20:05
[e2e0ff81] part of check-in [3c2e83a4] Fix memory leaks in the NGQP logic for virtual tables. (check-in: [3c2e83a4] user: drh branch: nextgen-query-plan-exp, size: 250191)
14:14
[409691be] part of check-in [bd9327a9] NGQP working with virtual tables, though many legacy tests fail and there are yet some memory leaks. (check-in: [bd9327a9] user: drh branch: nextgen-query-plan-exp, size: 250147)
04:22
[c02037ef] part of check-in [8e5aad37] More bug fixes to the WhereLoop generator and the solver in NGQP. Now finds the best plan for TPC-H Q8. This seems to prove the concept, but there is still much work to be done. (check-in: [8e5aad37] user: drh branch: nextgen-query-plan-exp, size: 243041)
03:22
[22da73b7] part of check-in [b36034bb] Bug fixes in the solver. (check-in: [b36034bb] user: drh branch: nextgen-query-plan-exp, size: 243065)
03:05
[cac7c10d] part of check-in [5d37587c] Add the NGQP solver. (check-in: [5d37587c] user: drh branch: nextgen-query-plan-exp, size: 242610)
2013-05-07
23:06
[e957c2c6] part of check-in [15cc8a16] Continued progress on generating good WhereLoop objects for the new query planner. (check-in: [15cc8a16] user: drh branch: nextgen-query-plan-exp, size: 238345)
19:44
[e987a4ff] part of check-in [e8881a8b] Inserting a few WhereLoop objects without leaking memory. Costs are not correct. Inequality and IN constraints are not implemented. (check-in: [e8881a8b] user: drh branch: nextgen-query-plan-exp, size: 236032)
2013-05-04
20:25
[173347e4] part of check-in [dd92b8fa] In where.c, make findTerm() a wrapper around methods to a new WhereScan object which is capable of finding all suitable matching terms, not just the first. This check-in includes some prototype functions for building WhereLoop objects. (check-in: [dd92b8fa] user: drh branch: nextgen-query-plan-exp, size: 235527)
2013-05-02
00:15
[fc62bea6] part of check-in [ccaf4c3f] Begin inserting some experimental code for the next generation query planner. (check-in: [ccaf4c3f] user: drh branch: nextgen-query-plan-exp, size: 228869)
2013-05-01
17:58
[12d4200e] part of check-in [faedaeac] Do not use a transitive constraint to an IN operator where the RHS is a constant if there exists a direct == operator to another table in an outer loop. (check-in: [faedaeac] user: drh branch: trunk, size: 221814)
17:22
[e36bbfbf] part of check-in [329478cb] Avoid redundant constraint checking due to transitive constraints. (check-in: [329478cb] user: drh branch: trunk, size: 221783)
2013-04-22
19:56
[d54e6308] part of check-in [49cfa14f] Do not allow a virtual table to cancel the ORDER BY clause unless all outer loops are guaranteed to return no more than one row result. Candidate fix for ticket [ba82a4a41eac1]. (check-in: [49cfa14f] user: drh branch: trunk, size: 221734)
02:39
[c7c74fe8] part of check-in [5f4907e1] Use transitivity to move constraints into the outer loops of a join whenever possible, thereby reducing the amount of work that needs to occur in inner loops. (check-in: [5f4907e1] user: drh branch: trunk, size: 221429)
2013-04-18
02:55
[e63f84e5] part of check-in [61b2a7be] Do not suppress the ORDER BY clause on a virtual table query if an IN constraint is used. Fix for ticket [f69b96e3076e]. Testing done on TH3 using cov1/where37.test. (check-in: [61b2a7be] user: drh branch: trunk, size: 220273)
2013-03-27
17:20
[4ad2329c] part of check-in [2936f746] In order to optimize out the ORDER BY clause, outer loops must generate values for ORDER BY terms that are unique or else the inner loops must generate no more than a single row. Fix for ticket [a179fe7465]. (check-in: [2936f746] user: drh branch: trunk, size: 220298)
16:42
[8179f4c8] part of check-in [c77ee6e2] Restore additional ORDER BY optimizations that where broken by the recent ORDER BY fix. (check-in: [c77ee6e2] user: drh branch: orderby-fix, size: 219897)
16:05
[fc912c1d] part of check-in [97e5c70f] Improved optimization of ORDER BY. (check-in: [97e5c70f] user: drh branch: orderby-fix, size: 219787)
15:04
[97986838] part of check-in [488089e6] A fix and test-case for the ORDER BY problem identified by ticket [a179fe7465]. This change causes sorting to occur in some cases where it is not strictly necessary. Further work is needed to avoid those extra sorts. (check-in: [488089e6] user: drh branch: orderby-fix, size: 219708)
2013-03-21
21:20
[9a16c0b8] part of check-in [6f6e2d50] Many spelling fixes in comments. No changes to code. (check-in: [6f6e2d50] user: mistachkin branch: trunk, size: 218932)
2013-03-12
23:58
[bdbbfa7e] part of check-in [7e7356f1] Add a single new test case to the ORDER BY with IN logic verify that if the RHS of the IN is a descending index that it still works. Add testcase() macros to the ORDER BY with IN logic to help verify that corner cases are tested. (check-in: [7e7356f1] user: drh branch: desc-orderby-fix-1, size: 218934)
20:38
[6fdacd2c] part of check-in [62316eba] Fix the ORDER BY optimization with IN constraints when the RHS of the IN constraint is a descending index. (check-in: [62316eba] user: drh branch: desc-orderby-fix-1, size: 218729)
18:49
[494da8b3] part of check-in [3ce7eb02] Revise the patch to make it easier to understand. (check-in: [3ce7eb02] user: drh branch: desc-orderby-fix-1, size: 218681)
18:40
[6c2940f1] part of check-in [8b2eb7a4] Revised fix for the DESC ORDER BY and IN constraint bug, ticket [4dd95f6943fbd18]. The previous check-in was incorrect. (check-in: [8b2eb7a4] user: drh branch: desc-orderby-fix-1, size: 218705)
18:34
[3db35b62] part of check-in [614a038a] A proposed fix for the DESC ORDER BY bug of ticket [4dd95f6943fbd18]. Seems to work, but lots more testing is needed prior to moving to trunk. (check-in: [614a038a] user: drh branch: desc-orderby-fix-1, size: 218802)
2013-03-06
01:55
[8b7690ca] part of check-in [7097241c] Fix a bug (ticket [fc7bd6358f59]) that caused incorrect query results in three way queries that involved comparing INTEGER and TEXT columns for equality. (check-in: [7097241c] user: drh branch: trunk, size: 218467)
2013-02-08
23:18
[43e05406] part of check-in [71b6c260] Fix a potential NULL-pointer dereference following an OOM error in the query planner logic for virtual tables with OR-connected terms. (check-in: [71b6c260] user: drh branch: IN-with-ORDERBY, size: 218348)
20:39
[df3f8f61] part of check-in [b016b754] Make sure the virtual tables that take advantage of IN operators sort the RHS of the IN operator in the correct order according to the ORDER BY clause. (check-in: [b016b754] user: drh branch: IN-with-ORDERBY, size: 218278)
18:48
[36370580] part of check-in [f78395c8] Loop through the elements on the RHS of an IN operator in reverse order when the ORDER BY clauses specifies DESC. (check-in: [f78395c8] user: drh branch: IN-with-ORDERBY, size: 217856)
16:04
[e09d21a4] part of check-in [a917c1f0] Allow the "a=?1 OR a=?2" to "a IN (?1,?2)" transformation to work on virtual tables again. This was formerly restricted because virtual tables could not optimize IN terms. (See check-in [fad88e71cf195e].) But IN terms are now used by virtual tables (as of check-in [3d65c70343]) so the restriction can now be removed. (check-in: [a917c1f0] user: drh branch: IN-with-ORDERBY, size: 217977)
2013-02-07
21:15
[74f8a582] part of check-in [98bf668a] Allow an index to be used for sorting even if prior terms of the index are constrained by IN operators. (check-in: [98bf668a] user: drh branch: IN-with-ORDERBY, size: 218542)
09:33
[427c6ec0] part of check-in [4a7b4ee0] Fix harmless compiler warnings. (check-in: [4a7b4ee0] user: drh branch: trunk, size: 218475)
2013-01-17
16:43
[374a6c81] part of check-in [593d67c8] Add the ability to disable transitive constraints using the sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) interface. (check-in: [593d67c8] user: drh branch: transitive-constraints, size: 218486)
16:18
[79c25769] part of check-in [56549f45] Avoid unnecessary collating sequence and affinity restrictions on the use of transitivity. Add test cases to show that the restrictions are not needed. (check-in: [56549f45] user: drh branch: transitive-constraints, size: 218414)
15:05
[701c32fe] part of check-in [d9676284] Make more aggressive use of transitivity in optimizing queries. Add a test case. (check-in: [d9676284] user: drh branch: transitive-constraints, size: 219137)
00:08
[24d74ec5] part of check-in [fe152f8b] Improved comments explaining the operation of the findTerm() utility routine in where.c. Increase the maximum number of levels of transitivity from 4 to 11. (check-in: [fe152f8b] user: drh branch: transitive-constraints, size: 219093)
2013-01-16
17:08
[eb1e1dfc] part of check-in [13171eb5] Enhance the query planner to exploit transitivity of join constraints in a multi-way join. (check-in: [13171eb5] user: drh branch: transitive-constraints, size: 217563)
00:46
[d48a57d8] part of check-in [d5ebb787] Improvements to query planning for joins: Avoid unnecessary calls to "optimal scan" checks in cases where table reordering is not possible. Make sure optimal scan checks are carried out for CROSS JOINs and LEFT JOINs. (check-in: [d5ebb787] user: drh branch: trunk, size: 215390)
2013-01-15
18:49
[b2a827f2] part of check-in [ac4e119a] Fix a missing word in a comment. Enhance the "wheretrace" debugging output to show the estimated cost of each table option while planning the join order. (check-in: [ac4e119a] user: drh branch: trunk, size: 213903)
16:15
[9df0419e] part of check-in [04507c17] Clarification to a comment in where.c. No code changes. (check-in: [04507c17] user: drh branch: trunk, size: 213866)
2013-01-09
11:44
[613a89f1] part of check-in [3d0609c9] Fix an over-aggressive optimization of ORDER BY on a three-way join where the second table is UNIQUE and the ORDER BY occurs on the third table. Ticket [c997b11c4d53a2ee]. (check-in: [3d0609c9] user: drh branch: branch-3.7.15, size: 212380)
11:31
[4c7fec9c] part of check-in [5774f217] Fix an over-aggressive optimization of ORDER BY on a three-way join where the second table is UNIQUE and the ORDER BY occurs on the third table. Ticket [c997b11c4d53a2]. (check-in: [5774f217] user: drh branch: trunk, size: 214002)
2012-12-19
17:10
[74d72b16] part of check-in [bae528f4] Backport to the 3.7.15 branch the fix to the segfault problem of ticket [a7b7803e8d1e869] which involved the use of "AS" named result columns as logical terms of the WHERE clause. Also, change the version number to 3.7.15.1. (check-in: [bae528f4] user: drh branch: branch-3.7.15, size: 212376)
15:53
[b971ee2d] part of check-in [3d0e00c7] Proposed fix for ticket [a7b7803e8d1e8699cd8a]. (check-in: [3d0e00c7] user: drh branch: tkt-a7b7803e, size: 213998)
2012-12-14
17:48
[7bdfde43] part of check-in [d2fb7619] Remove an unreachable branch. Improvements to comments. (check-in: [d2fb7619] user: drh branch: vtab-IN-opt, size: 213943)
15:54
[6bcd38a2] part of check-in [6d507e4d] Merge in all the trunk changes that have occurred since this branch was opened. (check-in: [6d507e4d] user: drh branch: vtab-IN-opt, size: 213744)
15:36
[87c95ca9] part of check-in [d6e045f8] Fix the virtual table IN optimizer so that it work even if the virtual table implementation leaves the sqlite3_index_info.aConstraintUsage[].omit flag clear for an equality constraint that it intends to use. (check-in: [d6e045f8] user: drh branch: vtab-IN-opt, size: 212030)
2012-12-08
22:14
[53b991af] part of check-in [92c9ab56] Factor some work out of the index loop of the bestBtreeIndex() routine for a small performance increase. (check-in: [92c9ab56] user: drh branch: trunk, size: 212321)
21:36
[b613cf5b] part of check-in [cdbfa664] Adjustments to the collating-sequence refactoring to facilitate full-coverage testing and to fix some minor issues found by TH3. (check-in: [cdbfa664] user: drh branch: ticket-71e333e7, size: 212189)
14:16
[f4b0ec5a] part of check-in [b3f53668] Make sure WHERE clause constraints A=B and B=A work the same even with COLLATE clauses. (check-in: [b3f53668] user: drh branch: ticket-71e333e7, size: 212198)
03:34
[fdf9eb05] part of check-in [7b96115e] Veryquick passes all tests now. (check-in: [7b96115e] user: drh branch: ticket-71e333e7, size: 212174)
2012-12-07
20:31
[bc400d45] part of check-in [f9fa7581] Many more tests are passing. Only about 100 failures remain in veryquick. (check-in: [f9fa7581] user: drh branch: ticket-71e333e7, size: 212086)
18:38
[5ad63b25] part of check-in [972443b4] Some errors in veryquick resolved. Many more to go. (check-in: [972443b4] user: drh branch: ticket-71e333e7, size: 211983)
14:02
[e415f983] part of check-in [7fafab12] Veryquick now runs to completion without segfaulting or asserting. But there are still lots of errors. (check-in: [7fafab12] user: drh branch: ticket-71e333e7, size: 211981)
2012-12-06
21:16
[1c7ff5ad] part of check-in [fd011cb2] Remove the Expr.pColl field and compute the collating sequence as it is needed. This fixes the test script "shared9.test", though there is still a memory leak. And there are other problems. Consider this a work-in-progress. (check-in: [fd011cb2] user: drh branch: ticket-71e333e7, size: 211966)
20:19
[13e6e3e1] part of check-in [0d7b5d45] Cherrypick [557c69055a3] and [0064bab7714] (OP_Once-related fixes for triggers). (check-in: [0d7b5d45] user: dan branch: branch-3.7.9, size: 201260)
2012-12-03
17:04
[b5325975] part of check-in [b0c1ba65] Make sure that the optimization that set the maximum column that will be used on a particular query does not mistakenly change an opcode other than OP_OpenRead or OP_OpenWrite. In particular, make sure it does not overwrite the P4 field of an OP_SorterOpen. (check-in: [b0c1ba65] user: drh branch: trunk, size: 211687)
2012-11-09
18:22
[832e33fe] part of check-in [51bfd63b] Disable the table selection rule that tried to prevent full table scans from migrating to the outer loop unless they were optimal. The new scaling of outer-loop costs by cost of inner loops obviates the need for that step. And, in fact, that step causes problems with the new inner-loop cost accounting. (check-in: [51bfd63b] user: drh branch: inner-loop-cost, size: 211637)
17:59
[b97f14d4] part of check-in [94255634] Try to take into account the cost of inner loops when selecting which table of a join to use for the outer loop. (check-in: [94255634] user: drh branch: inner-loop-cost, size: 212098)
2012-10-30
15:31
[6a753aa0] part of check-in [f83aa0de] Make sure that the optimizer never tries to create an automatic index on a coroutine subquery. (check-in: [f83aa0de] user: drh branch: subquery-as-coroutine, size: 211161)
00:29
[73eb4c41] part of check-in [7af3acbb] Add an optimization that attempts to run a subquery as a coroutine rather than manifesting it into a temporary table. (check-in: [7af3acbb] user: drh branch: subquery-as-coroutine, size: 211081)
2012-10-26
18:40
[bcd54574] part of check-in [ac1d5d8a] Make sure the automatic index optimization is checked even if the covering index scan optimization was previously selected. (check-in: [ac1d5d8a] user: drh branch: trunk, size: 210660)
2012-10-16
23:17
[62f667db] part of check-in [aa650746] Enable optimization of IN operators on constraints to virtual tables. (check-in: [aa650746] user: drh branch: vtab-IN-opt, size: 210941)
2012-10-09
21:07
[3e6c1f9e] part of check-in [dd34bec3] Merge the fix for ticket [d02e1406a58ea02] into trunk. (check-in: [dd34bec3] user: drh branch: trunk, size: 210607)
09:26
[410017c6] part of check-in [bb5c0f1c] Bring some comments up to date in the query planner, and especially the ORDER BY optimizer. Also add testcase() macros. (check-in: [bb5c0f1c] user: drh branch: trunk, size: 210596)
01:39
[7d24dda2] part of check-in [01dc032b] Remove an unused variable. Fix code that occurs before a variable declaration. (check-in: [01dc032b] user: drh branch: trunk, size: 210409)
01:23
[50d1d0d3] part of check-in [981b9943] Replace an always-false conditional with an assert(). (check-in: [981b9943] user: drh branch: trunk, size: 210523)
2012-10-08
21:51
[56916abb] part of check-in [c027a9af] Merge ORDER BY optimization refactoring and repair into trunk. (check-in: [c027a9af] user: drh branch: trunk, size: 210541)
21:01
[b74866c4] part of check-in [8314fd60] All test cases (veryquick.tcl and min.rc) pass. A few branch operations in ORDER BY optimization logic are untested by min.rc. (check-in: [8314fd60] user: drh branch: qp-enhancements, size: 210647)
20:27
[6bc65388] part of check-in [bcb4f262] Further tweaks to the ORDER BY optimizer, to fix a bug and to get the optimizer to recognize some additional cases. (check-in: [bcb4f262] user: drh branch: qp-enhancements, size: 210636)
19:41
[d4a39bc7] part of check-in [301bbee4] Bug fixes in the ORDER BY optimizer. (check-in: [301bbee4] user: drh branch: qp-enhancements, size: 210590)
18:23
[968bea25] part of check-in [adbdc663] Continued refactoring of the ORDER BY optimization logic. This check-in is close to working, but it still has issues. A few test cases fail. (check-in: [adbdc663] user: drh branch: qp-enhancements, size: 209946)
2012-10-05
14:43
[bf45ec77] part of check-in [8ea67522] Consolidate all occurrences of the "no such collation sequence" error message into a single spot. (check-in: [8ea67522] user: drh branch: trunk, size: 210628)
2012-10-04
16:00
[e74f9ed4] part of check-in [81fd941d] Candidate fix for ticket [d02e1406a58ea02]. (check-in: [81fd941d] user: drh branch: branch-3.7.14, size: 204990)
12:10
[f2468071] part of check-in [8f448745] Yet another refactoring of ORDER BY logic in the query planner. This particular check-in works mostly, but still has a few minor issues. (check-in: [8f448745] user: drh branch: qp-enhancements, size: 210556)
2012-10-03
18:09
[fabdb473] part of check-in [ba2f492f] Fix an out-of-order memset() that occurs before all variable declarations are finished. Also fix a line that exceeds the 80-character line length limit. (check-in: [ba2f492f] user: drh branch: trunk, size: 210734)
12:38
[cd99218c] part of check-in [0f9bb901] Fix a query planner problem that only occurs when covering-index-scan is disabled. Fix to tests whose output changed due to the new and more aggressive ORDER BY optimization. (check-in: [0f9bb901] user: drh branch: qp-enhancements, size: 210723)
00:25
[76de1934] part of check-in [6744d9a3] Further attempts to optimize out unnecessary ORDER BY clauses. (check-in: [6744d9a3] user: drh branch: qp-enhancements, size: 210671)
2012-10-02
15:19
[69398e95] part of check-in [abcf6a5d] More lenient handling of ORDER BY optimization in joins with mixed ASC/DESC. This is a better and less restrictive fix for the problem addressed by the previous check-in. (check-in: [abcf6a5d] user: drh branch: trunk, size: 209345)
14:11
[d40f2fa1] part of check-in [b0e7b4df] Only continue an ORDER BY optimization into inner loops if the equality constraints on the inner loop match terms of an outer ordered index that are actually used by the ORDER BY clause. (check-in: [b0e7b4df] user: drh branch: trunk, size: 209435)
01:46
[58a99bf5] part of check-in [545bb336] Factor an invariant out the loop termination condition for the ORDER BY satisfied-by-index analyzer routine. (check-in: [545bb336] user: drh branch: trunk, size: 209335)
01:25
[0a309f52] part of check-in [351dc8d9] Make sure the outer loop cursor numbers are recorded in time for them to be used by the ORDER BY optimizer. (check-in: [351dc8d9] user: drh branch: trunk, size: 209323)
01:10
[9f706f54] part of check-in [76b27765] Improvements to the wheretrace output. (check-in: [76b27765] user: drh branch: trunk, size: 209314)
2012-10-01
17:44
[e676efbf] part of check-in [c12044df] Minor changes to the query planner for improved test coverage. (check-in: [c12044df] user: drh branch: trunk, size: 209181)
2012-09-29
19:10
[acc2ec5f] part of check-in [62225b4a] Improved ORDER BY optimization when outer loops of a join return a single row. (check-in: [62225b4a] user: drh branch: trunk, size: 209147)
2012-09-27
23:27
[d836df3a] part of check-in [98b63371] Fix some corner case behavior in the new ORDER BY optimization logic. Remove the SQLITE_OrderByIdx bit from the SQLITE_TESTCTRL_OPTIMIZATIONS mask, since enabling it caused many TH3 tests to fail when the NO_OPT configuration parameter was engaged, and since there really isn't any need to turn that optimization off. The SQLITE_OrderByIdxJoin bit remains. (check-in: [98b63371] user: drh branch: qp-enhancements, size: 208896)
19:53
[cd047c12] part of check-in [0d573320] More test cases an bug fixes for the ORDER BY optimization of joins. All veryquick tests now pass. (check-in: [0d573320] user: drh branch: qp-enhancements, size: 208914)
17:31
[a537824b] part of check-in [75cda864] Test cases and bug fixes applied to the ORDER BY optimization for joins. Some test cases fail, but except for the new orderby1.test failures, all failures appear to be issues with the tests, not with the core code. (check-in: [75cda864] user: drh branch: qp-enhancements, size: 208713)
15:05
[4b837884] part of check-in [d2fcba1e] Add more bits to the bit vector that is used to disable optimizations for built-in test. Add specific bit patterns to disable ORDER BY using an index in general and for joins. Use macros to test for bits in the disabled-optimization bit vector, in order to make the code clearer. (check-in: [d2fcba1e] user: drh branch: qp-enhancements, size: 208368)
14:11
[36af33a9] part of check-in [c29538f9] Enable ORDER BY clauses that span joins to be optimized out. (check-in: [c29538f9] user: drh branch: qp-enhancements, size: 208390)
12:05
[67438c61] part of check-in [53efc10a] Further tweaks to the query planner logic in preparation for adding ORDER BY opt-out for joins. (check-in: [53efc10a] user: drh branch: qp-enhancements, size: 206719)
2012-09-26
23:17
[59b852d5] part of check-in [96496dda] Further refactoring of the ORDER BY related query-planning logic in order to make it easier to extend to support optimizing out ORDER BY on joins. No actual behavior changes, yet. (check-in: [96496dda] user: drh branch: qp-enhancements, size: 206627)
2012-09-25
20:43
[e75e67f0] part of check-in [4226e51f] Augment the WhereBestIdx structure to pass down into the query planner information that might be used to better detect ORDER BY and DISTINCT optimizations spanning multiple tables of a join. (check-in: [4226e51f] user: drh branch: qp-enhancements, size: 205718)
14:29
[82be1d2f] part of check-in [1104d42e] Pass information around between the major routines of the query planner using a single pointer to a structure rather than a long list of parameters. (check-in: [1104d42e] user: drh branch: qp-enhancements, size: 205288)
2012-09-24
19:50
[40708330] part of check-in [349a55cd] Remove an unused subfunction parameter and an obsolete comment from the query planner logic in where.c. (check-in: [349a55cd] user: drh branch: trunk, size: 206016)
15:30
[af126a6c] part of check-in [22989f35] Change the internal sqlite3WhereBegin() to report that the ORDER BY clause is satisfied by indices using the WhereInfo.nOBSat field of the returned structure. (check-in: [22989f35] user: drh branch: trunk, size: 205872)
2012-09-21
22:50
[3b52eeff] part of check-in [1be4b16b] Enable query planner tracing using the new (and undocumented) ".wheretrace 1" command in the command-line shell if both the shell and the core are compiled with SQLITE_DEBUG and SQLITE_ENABLE_WHERETRACE. This is not a supported API. Use for testing and debugging only. (check-in: [1be4b16b] user: drh branch: trunk, size: 205860)
2012-09-18
17:32
[95a2fe36] part of check-in [2be661a4] This change generates incorrect code when there are two or more IN operators in the WHERE clause that are both used by the same index. Was: Omit an unnecessary OP_IfNull that immediately follows an OP_Rowid. (check-in: [2be661a4] user: drh branch: mistake, size: 204981)
2012-09-17
21:24
[cc3ef08b] part of check-in [698b2a28] Make sure the WHERE_IDX_ONLY flag is not set on query plans that will not be using an index. (check-in: [698b2a28] user: drh branch: fullscan-covering-index, size: 205809)
20:44
[b124d9d7] part of check-in [ccb8ecc3] Add the ability to disable the covering-index-scan optimization at compile-time, start-time, or at run-time. Add test cases to check this configurability. (check-in: [ccb8ecc3] user: drh branch: fullscan-covering-index, size: 205775)
2012-09-15
18:45
[0d9970a6] part of check-in [cfaa7bc1] Attempt to use a covering index even on a full table scan, under the theory that the index will be smaller and require less disk I/O and thus be faster. (check-in: [cfaa7bc1] user: drh branch: fullscan-covering-index, size: 205628)
2012-08-25
02:11
[22783f42] part of check-in [929b5184] Fix a harmless compiler warning. (check-in: [929b5184] user: drh branch: trunk, size: 204979)
00:49
[a4b2ea85] part of check-in [865dfcba] Backport check-in [62678be3df35cd]: When the same index is used for all OR-terms in a WHERE clause, then try to use that index as a covering index. (check-in: [865dfcba] user: drh branch: branch-3.7.2, size: 203059)
2012-08-24
23:24
[9a28820f] part of check-in [b722143d] Move field WhereLevel.pCovidx inside the union to WhereLevel.u.pCovidx. (check-in: [b722143d] user: drh branch: multi-or-covering-index, size: 204973)
21:54
[27c9e43f] part of check-in [5499af53] Remove a NEVER() that is in fact reachable on an OOM. This probably has nothing to do with the multi-or-covering-index change but just happened to be found while testing that change. (check-in: [5499af53] user: drh branch: multi-or-covering-index, size: 204969)
18:44
[b95276a5] part of check-in [a3e26038] Fix a problem to do with multi-or queries and automatic indexes. (check-in: [a3e26038] user: dan branch: multi-or-covering-index, size: 204976)
10:52
[b4d98014] part of check-in [1dc8c7c7] Experimental change to support the covering index optimization for queries with OR terms in the WHERE clause that search a single index more than once. (check-in: [1dc8c7c7] user: dan branch: multi-or-covering-index, size: 205229)
2012-05-11
11:28
[24c7494d] part of check-in [2b77301b] Fix a harmless compiler warning. (check-in: [2b77301b] user: drh branch: trunk, size: 203244)
2012-04-20
16:59
[8e9f01cd] part of check-in [7b8548b1] Do not consider a DISTINCT clause redundant unless a subset of the result-set is collectively subject to a UNIQUE constraint and it can be guaranteed that all columns of the subset are NOT NULL (either due to NOT NULL constraints WHERE clause terms). Fix for [385a5b56b9]. (check-in: [7b8548b1] user: dan branch: trunk, size: 203255)
15:24
[e25ae482] part of check-in [9870e4c4] Fix for [2a5629202f]. When considering whether or not a UNIQUE index may be used to optimize an ORDER BY clause, do not assume that all index entries are distinct unless there is some reason to believe that the index contains no NULL values. (check-in: [9870e4c4] user: dan branch: trunk, size: 203021)
2012-03-29
14:29
[2112422a] part of check-in [0bacb879] Disable the LIKE optimization if the column on the left-hand-side of the LIKE operator belongs to a virtual table. (check-in: [0bacb879] user: dan branch: trunk, size: 202604)
2012-03-28
01:34
[44d78f58] part of check-in [b899dbeb] Evaluate typeof(X) and length(Y) where X is any column and Y is a blob column without actually loading X and Y from disk. (check-in: [b899dbeb] user: drh branch: faster-typeof-and-length, size: 202568)
2012-03-16
00:28
[6baab5df] part of check-in [74eadeec] Fix harmless compiler warnings. (check-in: [74eadeec] user: drh branch: trunk, size: 202565)
2012-03-09
22:02
[d4ce63a2] part of check-in [0dc4cb93] Candidate fix for the optimizer problem described in ticket [b7c8682cc17f3] which can causes a LEFT JOIN to be changed into a INNER JOIN if there are OR terms in the WHERE clause. (check-in: [0dc4cb93] user: drh branch: trunk, size: 202603)
2012-03-03
00:34
[f2cf5975] part of check-in [dec9a995] Fix a bug [3557ad65a07] that causes incorrect DISTINCT processing on an indexed query involving the IN operator. (check-in: [dec9a995] user: drh branch: trunk, size: 201891)
2011-12-09
13:24
[af623942] part of check-in [557c6905] Modify the OP_Once opcode so that it works correctly in trigger sub-programs. This is a candidate fix for [7bbfb7d442]. (check-in: [557c6905] user: dan branch: trunk, size: 201848)
2011-11-16
15:27
[f73752ca] part of check-in [3b58f5f0] Where possible, take advantage of the rowid at the end of index records to optimize range constraints (<, >, <=, >=) on the rowid column. (check-in: [3b58f5f0] user: dan branch: trunk, size: 201962)
2011-10-21
19:06
[7c85f4c9] part of check-in [aed2bf7a] Purge lingering references to SQLITE_STAT2 from the code and test scripts. (check-in: [aed2bf7a] user: drh branch: trunk, size: 201374)
16:47
[922145a3] part of check-in [76de9914] Remove stale requirements marks from the query planner. (check-in: [76de9914] user: drh branch: trunk, size: 201374)
2011-10-18
19:14
[b617d9e1] part of check-in [54aecd92] Fix an uninitialized variable in OR-clause processing. (check-in: [54aecd92] user: drh branch: trunk, size: 201449)
2011-10-15
00:16
[813233b3] part of check-in [39408702] Added the tool/warnings-clang.sh script. Changes so that there are no warnings with either gcc or clang even including FTS4 and RTREE and both with and without SQLITE_THREADSAFE=0. (check-in: [39408702] user: drh branch: trunk, size: 201416)
2011-10-14
21:49
[0db7e2db] part of check-in [60fee957] Add assert() statements and eliminate needless variable assignments in order to get the clang scan-build utility to report zero problems against the SQLite core. Clang's static analysis did find one real problem - but it was in the command-line shell, not in the SQLite core. (check-in: [60fee957] user: drh branch: trunk, size: 201425)
2011-10-11
12:39
[12939ac4] part of check-in [9325c1a8] Fix requirements marks associate with STAT3. (check-in: [9325c1a8] user: drh branch: trunk, size: 201330)
2011-10-07
17:45
[a6d127dd] part of check-in [5c132592] Add testcase() macros to ensure good test coverage. (check-in: [5c132592] user: drh branch: or-opt, size: 201330)
14:40
[2e82da48] part of check-in [9fca05ea] Prevent infinite recursion of in the query planner for some pathological test cases by disabling OR-clause processing upon first recursion. (check-in: [9fca05ea] user: drh branch: or-opt, size: 201219)
13:33
[80c53e8e] part of check-in [876bd21a] Begin an effort to enhance the query planner to do a better job with OR terms in the WHERE clause. This change allows ANDs outside of the OR to be factored into the OR terms if that is helpful in finding better indices. (check-in: [876bd21a] user: drh branch: or-opt, size: 200900)
2011-09-23
13:59
[aafcb21a] part of check-in [be44928c] Testability enhancements. (check-in: [be44928c] user: drh branch: stat3-trunk, size: 199560)
2011-09-22
18:46
[432a42cf] part of check-in [3ca7e449] Fix an issue in ANALYZE when STAT3 is disabled but both sqlite_stat2 and sqlite_stat3 tables exist. Also add testability tweaks to the STAT3 code. (check-in: [3ca7e449] user: drh branch: stat3-trunk, size: 199523)
00:28
[bd9ca1bb] part of check-in [ee110d5a] Fix an uninitialized variable and a misuse of memcpy(). (check-in: [ee110d5a] user: drh branch: stat3-trunk, size: 199488)
2011-09-21
00:09
[da04df6f] part of check-in [63fc3e4b] Pull in the latest changes from trunk. Update the STAT3 documentation. (check-in: [63fc3e4b] user: drh branch: stat3-trunk, size: 199488)
2011-09-16
19:29
[4d732166] part of check-in [51908c8f] Merge all the latest trunk changes into the experimental STAT3 branch. (check-in: [51908c8f] user: drh branch: stat3-trunk, size: 199488)
19:04
[b641d399] part of check-in [cf51ef8a] Remove unreachable branches from the previous change. Add additional test cases. (check-in: [cf51ef8a] user: drh branch: trunk, size: 201582)
17:43
[73234bca] part of check-in [0156f10e] When analyzing the right-hand side of IN operators to see if the IN operator can work with an index, be sure to decend into nested subqueries. Fix for ticket [1a1308d2538d7] (check-in: [0156f10e] user: drh branch: trunk, size: 201576)
01:34
[e7be3516] part of check-in [7f00552b] Add the new OP_Once opcode. Use it to clean up and simplify various one-time initialization sections in the code, including the fix for ticket [002caede898ae]. (check-in: [7f00552b] user: drh branch: tkt-002caede898, size: 201337)
2011-08-26
13:52
[9323b7a6] part of check-in [0df04f92] Merge branches branch-3.7.2 and stat3-enhancement into a new branch for testing purposes. (check-in: [0df04f92] user: drh branch: stat3-3.7.2, size: 199244)
2011-08-16
17:06
[3d9a78a4] part of check-in [3d68f9af] Fix a few harmless compiler warnings. Add SQLITE_ENABLE_STAT3 to the standard compiler warning script. (check-in: [3d68f9af] user: drh branch: stat3-enhancement, size: 199291)
2011-08-13
19:35
[11889623] part of check-in [89b2f708] Further testing and bug fixing for sqlite_stat3. Added the Index.avgEq field to index statistics. Fixed several problems in the query planner associated with stat3. (check-in: [89b2f708] user: drh branch: stat3-enhancement, size: 199296)
2011-08-12
01:51
[24d95b21] part of check-in [52e1d7e8] Begin a branch that experimentally replaces sqlite_stat2 with a new table called sqlite_stat3 that will hopefully facilitate better query planning decisions. (check-in: [52e1d7e8] user: drh branch: stat3-enhancement, size: 198995)
2011-08-08
17:18
[67c87af7] part of check-in [d1248165] Add code to actually use the sqlite_stat2.cnt field in the query planner. This changes some plans resulting in a few failures in analyze5.test. (check-in: [d1248165] user: drh branch: query-planner-tweaks, size: 202535)
2011-08-06
19:48
[67ad221f] part of check-in [6d1e2372] The sqlite_stat2.cnt field is parsed if it is present. But it is not yet used. A large comment added to analyze.c to explain the format of the ANALYZE system tables. (check-in: [6d1e2372] user: drh branch: query-planner-tweaks, size: 201390)
2011-08-05
01:09
[b8ebb50b] part of check-in [b9d41c34] Allow the sqlite_stat2 table to contain a number of samples other than the default of 10. (check-in: [b9d41c34] user: drh branch: query-planner-tweaks, size: 201375)
2011-08-03
01:07
[e1692422] part of check-in [c8ba8855] Adjust the output row estimating logic when using STAT2. (check-in: [c8ba8855] user: drh branch: query-planner-tweaks, size: 201385)
2011-08-02
01:57
[7d09f4c1] part of check-in [a55f4ab9] Make sure IS NOT NULL constraints work on virtual tables. Fix for ticket [6c14288a473ceff]. (check-in: [a55f4ab9] user: drh branch: trunk, size: 201385)
2011-07-13
18:53
[db40458b] part of check-in [d55b64ef] Cherrypicked from trunk: Do not try to use STAT2 for row estimates if the index is unique or nearly so. (check-in: [d55b64ef] user: drh branch: branch-3.7.2, size: 201330)
18:31
[106cd9ab] part of check-in [efffc49b] Do not try to use STAT2 to refine the row estimate of a query that uses a unique or nearly-unique index. (check-in: [efffc49b] user: drh branch: trunk, size: 201289)
2011-07-12
14:48
[def5ef53] part of check-in [7afb2354] Cherrypick change [9f14fa56ba] (the fix for [54844eea3f]) from the trunk. (check-in: [7afb2354] user: dan branch: branch-3.7.2, size: 201235)
2011-07-11
15:52
[bc46a3e6] part of check-in [8daf6e1b] Here is an attempted enhancement to the query planner that didn't work out. But it seems good to save this change for historical reference, even if it does not belong on the trunk. (check-in: [8daf6e1b] user: drh branch: query-planner-deadend, size: 201520)
2011-07-09
13:00
[ce7cce80] part of check-in [418a4da2] In where.c::findIndexCol - make sure that the Expr.op is TK_COLUMN before accessing the Expr.iColumn and Expr.iTable fields. Also fix a couple of unreachable branches. (check-in: [418a4da2] user: drh branch: trunk, size: 201194)
2011-07-08
16:10
[defae982] part of check-in [9f14fa56] Fix for [54844eea3f]: Do not create automatic indexes on correlated sub-queries. (check-in: [9f14fa56] user: dan branch: trunk, size: 201164)
13:07
[c814c35a] part of check-in [18501dd1] Extend the SQLITE_TESTCTRL_OPTIMIZATIONS option to disable DISTINCT optimizations. (check-in: [18501dd1] user: drh branch: trunk, size: 201047)
2011-07-02
19:12
[c80c154d] part of check-in [ff9fc722] Add a testcase macro to ensure testing a boundary case in DISTINCT processing. (check-in: [ff9fc722] user: drh branch: trunk, size: 200859)
15:42
[f4561d52] part of check-in [9bbcd8c0] Cherrypick change [27c65d4d9c] into the 3.7.2 branch. (check-in: [9bbcd8c0] user: dan branch: branch-3.7.2, size: 201118)
15:32
[30dc117e] part of check-in [27c65d4d] Ensure that automatic indexes are only created in scenarios where they may be used more than once. (check-in: [27c65d4d] user: dan branch: trunk, size: 200820)
13:34
[ecdf9bfa] part of check-in [c593792c] Cherrypick [45e581bff7] into the 3.7.2 branch. (check-in: [c593792c] user: dan branch: branch-3.7.2, size: 200986)
06:44
[dcc0d91c] part of check-in [090b2917] Fix a broken assert() in where.c. (check-in: [090b2917] user: dan branch: experimental, size: 200688)
2011-07-01
18:26
[83cf8e86] part of check-in [6c202ea0] Improve use of indexes to optimize DISTINCT queries. (check-in: [6c202ea0] user: dan branch: experimental, size: 200583)
14:21
[207cf2c1] part of check-in [7337293c] Improvements and tests for detection of redundant DISTINCT qualifiers. (check-in: [7337293c] user: dan branch: experimental, size: 197585)
2011-06-30
20:17
[0bdcf670] part of check-in [f7ba0219] Experimental changes to improve optimization of DISTINCT queries. (check-in: [f7ba0219] user: dan branch: experimental, size: 197761)
2011-04-09
03:30
[c2320551] part of check-in [80353020] Back port the unordered-index-hack to the 3.7.2 branch. (check-in: [80353020] user: drh branch: branch-3.7.2, size: 194256)
03:20
[55403ce1] part of check-in [8a42e236] If the keyword "unordered" appears at the end of the SQLITE_STAT1.STAT column for an index, then use that index for equality lookups only, never for range queries or sorting. This feature is currently undocumented and my change or be removed in a future release. (check-in: [8a42e236] user: drh branch: trunk, size: 193958)
2011-04-08
23:04
[6a465e78] part of check-in [e8177e01] Make sure the left-hand side of the IS NOT NULL operator is a simple column and not a general expression before applying the IS NOT NULL optimization. This is a backport of check-in [543f75a6abe3]. (check-in: [e8177e01] user: drh branch: branch-3.7.2, size: 194198)
21:35
[494d1069] part of check-in [543f75a6] Always make sure the left-hand side of the IS NOT NULL operator is a simple column, not a general expression, before applying the IS NOT NULL query optimization. (check-in: [543f75a6] user: drh branch: trunk, size: 193900)
2011-04-07
19:56
[9af38108] part of check-in [5bbfa17d] Change two new internal functions in where.c from global to file scope. (check-in: [5bbfa17d] user: drh branch: trunk, size: 193861)
2011-04-05
22:08
[71e6808f] part of check-in [3eeb0ff7] Suppress many harmless compiler warnings, mostly signed/unsigned comparisons within asserts or unused parameters in extensions. (check-in: [3eeb0ff7] user: drh branch: trunk, size: 193847)
2011-04-01
02:26
[176574bf] part of check-in [e3bf2d5c] Fix two compiler errors associated with non-standard compile-time options. (check-in: [e3bf2d5c] user: drh branch: trunk, size: 193842)
2011-03-31
18:36
[51e6657e] part of check-in [a5aae174] Provide hints to the btree layer Next and Previous primitives to let them know if they can be no-ops if the underlying index is unique. (check-in: [a5aae174] user: drh branch: branch-3.7.2, size: 194159)
2011-03-29
15:00
[8614b235] part of check-in [3b964155] If the keyword "unordered" appears at the end of the SQLITE_STAT1.STAT column for an index, then use that index for equality lookups only, never for range queries or sorting. (check-in: [3b964155] user: drh branch: unordered-index-hack, size: 193900)
2011-03-17
01:58
[a6e89fe7] part of check-in [869f8947] Comment enhancement to better explain the logic in the "x IS NULL" optimization. (check-in: [869f8947] user: drh branch: trunk, size: 193842)
01:53
[deee5203] part of check-in [68daf20d] Backport the "x IS NULL" query planner enhancement of [2353176811f] to the 3.7.2 branch. (check-in: [68daf20d] user: drh branch: branch-3.7.2, size: 193965)
01:34
[a41a1c64] part of check-in [23531768] Enhances to the query planner such that "x IS NULL" constraints take the STAT2 statistics into account, just like "x=VALUE" constraints. (check-in: [23531768] user: drh branch: trunk, size: 193758)
2011-03-09
22:09
[124e56fc] part of check-in [2d55234e] Backport the OP_Next and OP_Prev for UNIQUE indices patch from checkin [f000c9b2b7] on the trunk. (check-in: [2d55234e] user: drh branch: branch-3.7.2, size: 193776)
21:02
[27c2f4e2] part of check-in [f000c9b2] Omit unnecessary OP_Next and OP_Prev operators when uniqueness constraints guarantee that the code will only make one pass through the loop. (check-in: [f000c9b2] user: drh branch: trunk, size: 193569)
2011-03-06
21:28
[3bc364ee] part of check-in [01a79d5a] Remove dead code identified by the clang static analyzer. (check-in: [01a79d5a] user: drh branch: trunk, size: 193442)
2011-03-04
01:23
[4d5918de] part of check-in [440d9956] Backport the query planner enhancement of [952f5e8c69904] to the 3.7.2 branch. (check-in: [440d9956] user: drh branch: branch-3.7.2, size: 193649)
00:56
[d7b07386] part of check-in [952f5e8c] Do a better job of choosing the join table order when the tables having very different numbers of rows. (check-in: [952f5e8c] user: drh branch: trunk, size: 193619)
2011-02-17
13:52
[bf8c0f58] part of check-in [21db7191] Remove an assert() that was made redundant by the previous checkin. (check-in: [21db7191] user: drh branch: trunk, size: 193535)
13:33
[259a7274] part of check-in [8123283e] Add an ALWAYS() around a always-true test in where.c. (check-in: [8123283e] user: drh branch: trunk, size: 193581)
2011-02-16
23:32
[ebc53143] part of check-in [31fc4ba6] Fix harmless compiler warnings in the query planner. (check-in: [31fc4ba6] user: drh branch: trunk, size: 193573)
2011-02-11
06:59
[9c140acd] part of check-in [a5c36b9f] Fix a bug in the new WHERE-clause processing that tries to use an index to resolve IS NOT NULL constraints when SQLITE_ENABLE_STAT2 is defined. The bug could cause memory overruns and segfaults. The bug was new to the code and has not appeared in an official release. Found during structural testing. (check-in: [a5c36b9f] user: drh branch: trunk, size: 193565)
03:56
[96d634b8] part of check-in [d78949fc] Allow an index paired with an IS NULL constraint to be used for sorting under the condition that the index be treated as a non-unique index. (check-in: [d78949fc] user: drh branch: trunk, size: 193517)
02:43
[612ca339] part of check-in [5ecd1178] Disable unused NULL tests when SQLITE_ENABLE_STAT2 is not in use. (check-in: [5ecd1178] user: drh branch: trunk, size: 193251)
2011-02-10
17:46
[ebecb7b9] part of check-in [f01030a0] Prevent a segfault when automatic indices try to use a column with an unknown collating function. Ticket [77aa3b1e6592582e38605d36]. This check-in also removes some stray \r characters unrelated to the problem. (check-in: [f01030a0] user: drh branch: trunk, size: 193146)
00:08
[83a89fe4] part of check-in [878da276] Refactor the cost function in the query planner. Give extra cost (thus reduce likelihood of selection) to full table scans. (check-in: [878da276] user: drh branch: trunk, size: 193081)
2011-02-09
03:04
[0ff78ba4] part of check-in [5f2ec44b] Use macros to define the relative costs of search and seek operations when computing costs in the query planner. Current constants seems wrong and need to be fixed, but doing so will alter test results. Need more experimentation to determine accurate relative costs. (check-in: [5f2ec44b] user: drh branch: trunk, size: 193475)
2011-01-28
01:57
[f4915ac0] part of check-in [4847c6cb] Change the weighting of binary searches on tables to 1/10th the cost of a search on an index. Change the assumed reduction in search space from a indexed range constraint from 1/3rd to 1/4th. Do not let the estimated number of rows drop below 1. (check-in: [4847c6cb] user: drh branch: stat2-enhancement, size: 192073)
2011-01-24
15:11
[87de2616] part of check-in [b442525b] Change the cost estimator in the query planner to take into account the logN rowid lookup cost when going from an index to a table. (check-in: [b442525b] user: drh branch: stat2-enhancement, size: 189643)
2011-01-22
00:10
[99a9ea77] part of check-in [5d5bddd2] Add the ability to use indices for constraints of the form "x IS NOT NULL" when sqlite_stat2 is available and most entries for column x are NULL. (check-in: [5d5bddd2] user: drh branch: stat2-enhancement, size: 189660)
2011-01-21
18:18
[2de6723c] part of check-in [c82cb9c0] Adjustments to the result row estimator for the IN operator so that it gives the same estimates as the equivalent OR operator. Test cases for the same. (check-in: [c82cb9c0] user: drh branch: stat2-enhancement, size: 188060)
16:27
[7f2844af] part of check-in [fd3977a2] Make use of histogram data to make better estimates for the number of rows that will be returned from "x IN (v1,v2,v3,...)" constraints. (check-in: [fd3977a2] user: drh branch: stat2-enhancement, size: 187612)
14:37
[cf219a42] part of check-in [f73a167b] Add the ability to use indices when a range contraint is bounded on the lower end by NULL. (check-in: [f73a167b] user: drh branch: stat2-enhancement, size: 184667)
2011-01-20
16:52
[068ecc51] part of check-in [6bfc5c69] Use histogram data to improve the row-count estimates on equality constraints. (check-in: [6bfc5c69] user: drh branch: stat2-enhancement, size: 184007)
02:56
[5cd6b88d] part of check-in [2cd374cd] The first of a planned series of enhancements to the query planner that enable it to make better use of sqlite_stat2 histograms when the table has many repeated values. (check-in: [2cd374cd] user: drh branch: stat2-enhancement, size: 181610)
2010-12-16
19:52
[af069e6b] part of check-in [70a3d817] Fix an assertion fault that can only occur if SQLITE_ENABLE_STAT2 is defined and the constant folding optimization is disabled using sqlite3_test_control(). Problem introduced by [ad8bc68197f2b4] but we missed it prior to the 3.7.4 release due to taking shortcuts and skipping tests in the release checklist. (check-in: [70a3d817] user: drh branch: trunk, size: 180630)
2010-11-18
13:47
[fa22d45b] part of check-in [6c4f1d5c] Fix compiler warnings. (check-in: [6c4f1d5c] user: drh branch: trunk, size: 180776)
2010-11-16
02:49
[d5cc65f5] part of check-in [56bbc539] Use the estimated number of rows computed for subqueries in the cost computations for outer queries. (check-in: [56bbc539] user: drh branch: trunk, size: 180788)
2010-11-15
21:50
[6ba0540b] part of check-in [d52b5939] Change the EQP output for the min/max optimization from "SCAN" to "SEARCH". Other changes in where.c in support of full branch coverage testing. (check-in: [d52b5939] user: drh branch: trunk, size: 180715)
16:29
[f4023c5f] part of check-in [136c2ac2] Fix the EQP logic so that it correctly reports OOM errors while formatting "detail" text. (check-in: [136c2ac2] user: drh branch: trunk, size: 180511)
2010-11-13
16:42
[5a982c34] part of check-in [6611b76b] Change the EXPLAIN QUERY PLAN output to use "USING INDEX" instead of "BY INDEX", and to use "SEARCH" instead of "SCAN" for loops that are not full-table scans. (check-in: [6611b76b] user: dan branch: experimental, size: 180496)
2010-11-12
15:36
[2a5a0c68] part of check-in [6fdae9a6] Reduce the number of branches that need to be tested in the explainIndexRange() function of where.c. (check-in: [6fdae9a6] user: drh branch: experimental, size: 180250)
2010-11-11
11:43
[6c1905c8] part of check-in [7ae06895] Fix a bug in the EXPLAIN QUERY PLAN code. (check-in: [7ae06895] user: dan branch: experimental, size: 179477)
2010-11-09
17:35
[2b69056f] part of check-in [925f35c5] Add missing comments and fix other issues with routines used by new EQP features. (check-in: [925f35c5] user: dan branch: experimental, size: 179427)
14:49
[8aded05b] part of check-in [73c93f5a] Further enhancements and fixes for explain query plan. (check-in: [73c93f5a] user: dan branch: experimental, size: 178428)
2010-11-08
19:01
[ddfe0e1a] part of check-in [f4747eb8] Experimental changes to EXPLAIN QUERY PLAN. (check-in: [f4747eb8] user: dan branch: experimental, size: 177981)
2010-10-21
03:13
[d9a31eb3] part of check-in [1e0db997] Add new WHERETRACE macros for better diagnostics of the query planner. Added a new test case for the performance regression fixed by the previous check-in. (check-in: [1e0db997] user: drh branch: trunk, size: 175902)
02:05
[4ca22dea] part of check-in [28ba6255] Fix the query planner so that it uses the multi-index OR-clause solution if that is the lowest cost estimate. A prior bug cause the multi-index solution to be ignored in some circumstances. (check-in: [28ba6255] user: drh branch: trunk, size: 175620)
2010-10-04
23:55
[204cdfb6] part of check-in [ece641eb] Fix a performance regression (relative to version 3.6.23.1) caused by the query planner taking into account non-indexable WHERE clause terms to select the outermost join loops when it should be selecting tables for the outermost loop that do not benefit from being in an inner loop. (check-in: [ece641eb] user: drh branch: trunk, size: 175580)
2010-09-25
22:32
[34c733f9] part of check-in [a7645d29] Enhance the ANALYZE command so that it gathers statistics in the sqlite_stat1 table even for tables that are empty or have no indices. (check-in: [a7645d29] user: drh branch: trunk, size: 174814)
2010-09-14
18:23
[a5040c00] part of check-in [3e11f515] Clarify the documentation to better explain when an automatic re-prepare can be induced by rebinding parameters. Add evidence marks to the automatic re-prepare logic. (check-in: [3e11f515] user: drh branch: trunk, size: 175238)
2010-08-17
23:13
[0777e1f8] part of check-in [220cca50] Cherrypick the changes for enhancement requests [e090183531fc27474] (use indices on LIKE with no wildcards) and [4711020446da7d93d993] (use nocase index for LIKE even if the column is binary) into the 3.6.23.1 release of the Apple-OSX branch. (check-in: [220cca50] user: drh branch: apple-osx-3623, size: 156561)
2010-08-06
02:10
[7db3e41c] part of check-in [a7a15547] Change two automatic array variables into static constant arrays. Update and reformat some comments for cleaner presentation. (check-in: [a7a15547] user: drh branch: trunk, size: 175153)
2010-08-05
02:52
[a4b2cb14] part of check-in [309bbedf] Fix the query planner so that when it has a choice of full-scan tables to move to the outer loop, it chooses the one that is likely to give the fewest output rows. Ticket [13f033c865f878]. (check-in: [309bbedf] user: drh branch: trunk, size: 175065)
2010-08-04
21:17
[a1398b29] part of check-in [e7a714b5] If the outer loop of a join must be a full table scan, make sure that an incomplete ANALYZE does not trick the planner into use a table that might be indexable in an inner loop. Ticket [13f033c865f878] (check-in: [e7a714b5] user: drh branch: trunk, size: 174151)
2010-07-24
19:08
[8cf9ca6f] part of check-in [e5ecb159] Additional malloc sanity changes. Use sqlite3MemLink() on Index.zColAff and Table.zColAff as a proof of concept. (check-in: [e5ecb159] user: drh branch: malloc-enhancement, size: 172904)
16:34
[79202ca8] part of check-in [ac1f37a6] Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and all memory from sqlite3_malloc() is freed by sqlite3_free(). (check-in: [ac1f37a6] user: drh branch: malloc-enhancement, size: 172980)
2010-07-22
22:40
[62262cee] part of check-in [f3f9e8e5] Add evidence marks to the where.c source file. Comment only - no code changes. (check-in: [f3f9e8e5] user: drh branch: trunk, size: 172993)
17:49
[19a0f80a] part of check-in [9f932655] Enhance the LIKE/GLOB query optimization so that it works as long as there is an index with the appropriate collating sequence and even if the default collating sequence of the column is different. Ticket [4711020446da7d93d99]. (check-in: [9f932655] user: drh branch: trunk, size: 171654)
12:33
[3ba8350d] part of check-in [613a87d6] Try to optimize LIKE and GLOB operators when RHS contains no wildcard. Ticket [e090183531fc274747] (check-in: [613a87d6] user: drh branch: trunk, size: 172092)
2010-07-14
20:23
[903a7828] part of check-in [fd130ae5] The expression list on the RHS of an IN operator can no longer be empty because an empty expression list is now optimized out by changes in check-in [c288ac644d0bf]. Therefore add ALWAYS() macros around tests for the expression list being non-empty. (check-in: [fd130ae5] user: drh branch: trunk, size: 172105)
2010-07-03
01:44
[926c83c6] part of check-in [15bb6233] Fix a buffer overrun in the where.c. Problem detected by valgrind. (check-in: [15bb6233] user: drh branch: mistake, size: 172097)
2010-07-02
17:05
[9c642e4f] part of check-in [70833877] Fix some warnings when compiling under MSVC. (check-in: [70833877] user: shaneh branch: mistake, size: 172076)
2010-06-09
15:47
[1c895bef] part of check-in [6eb058dd] Fix for ticket [f973c7ac31]. (check-in: [6eb058dd] user: dan branch: trunk, size: 172071)
2010-04-30
21:03
[75fee9e2] part of check-in [946e06cd] Avoid assertion faults in queries using indices with redundant columns. Ticket [3dbdcdb14e7f41]. (check-in: [946e06cd] user: drh branch: trunk, size: 171845)
2010-04-15
12:36
[faadd9c2] part of check-in [33b1f584] Fix a problem in the result set size estimation logic of the query planner - a problem introduced by the two previous changes. (check-in: [33b1f584] user: drh branch: wal, size: 171708)
01:04
[74ff6f0d] part of check-in [defaf0d9] Further refinements to table order selection on join query planning. (check-in: [defaf0d9] user: drh branch: trunk, size: 170921)
2010-04-14
19:01
[458b6e0d] part of check-in [b87cb0c2] The query planner uses non-indexable WHERE clause terms to reduce the estimated number of output rows, then uses the estimated number of output rows as a tie-breaker when choosing table order. (check-in: [b87cb0c2] user: drh branch: trunk, size: 169582)
2010-04-08
17:28
[9472b113] part of check-in [b04a5282] Fix code coverage problems in where.c. (check-in: [b04a5282] user: drh branch: trunk, size: 168233)
15:01
[93621d17] part of check-in [edeab06a] Fix the computation of the number of rows in a table during automatic index generation. (check-in: [edeab06a] user: drh branch: trunk, size: 168260)
14:38
[15a4eef6] part of check-in [af97b488] Fix an integer overflow bug in the automatic index logic. The bug was detected by the testcase() macros added in the previous check-in. Also add some more testcase() macros, since this issue points up their importance. (check-in: [af97b488] user: drh branch: trunk, size: 168256)
14:15
[3a4a3291] part of check-in [72865478] Add testcase() macros to the automatic index logic to insure that boundary cases are tested. (check-in: [72865478] user: drh branch: trunk, size: 168127)
00:40
[28c270dc] part of check-in [d067d9f7] When constructing automatic indices do not include the same column more than once. (check-in: [d067d9f7] user: drh branch: experimental, size: 167989)
2010-04-07
16:54
[b3a57071] part of check-in [a811a47f] Wrap all automatic index changes inside SQLITE_OMIT_AUTOMATIC_INDEX. Add the automatic_index PRAGMA to turn it on and off. (check-in: [a811a47f] user: drh branch: experimental, size: 167656)
14:59
[186b72b0] part of check-in [23643131] Make sure that all automatic indices are covering indices. Otherwise, the table and index might be used together in a query but the table could get out of sync with the automatic index through out-of-band changes. (check-in: [23643131] user: drh branch: experimental, size: 167172)
2010-04-06
22:33
[68316204] part of check-in [abbf16e5] Veryquick.test is now working. The SQLITE_STMTSTATUS_AUTOINDEX counter added. (check-in: [abbf16e5] user: drh branch: experimental, size: 165576)
18:51
[7e924eac] part of check-in [a8224448] Runs quicktest without hitting an assert now. Some tests get unexpected results still and there is a memory leak. (check-in: [a8224448] user: drh branch: experimental, size: 165378)
18:28
[4112c801] part of check-in [ac6d0fba] Progress toward getting automatic indices to work. Still failing in corner cases. (check-in: [ac6d0fba] user: drh branch: experimental, size: 165502)
15:57
[31a93f75] part of check-in [1b2a0412] Automatically generate transient indices for tables in joins that would otherwise have to use a full table scan. (check-in: [1b2a0412] user: drh branch: experimental, size: 164638)
2010-03-31
17:47
[8bbb34e8] part of check-in [06b9ca32] Clarification of the implementation of SQLITE_STMTSTATUS_FULLSCAN_STEP. No logical code changes - just commenting and layout changes to improve readability. (check-in: [06b9ca32] user: drh branch: trunk, size: 157427)
2010-03-27
09:44
[71ef4e89] part of check-in [9e075e70] Increase the estimated cost of using a virtual table as the outer loop of a join when there exists an ORDER BY clause that is not satisfied by the virtual table. Fix for [775b39dd3c]. (check-in: [9e075e70] user: dan branch: trunk, size: 157341)
2010-02-25
04:15
[399ea4c0] part of check-in [f0ae251a] Make sure the ON clause of a LEFT JOIN does not cause an index to be used to speed access to a table to the left of the join. Ticket [ebdbadade5] (check-in: [f0ae251a] user: drh branch: trunk, size: 157012)
02:32
[0fab05c9] part of check-in [46f406b2] Merge in all of the logging enhancements. This is a cherrypick merge of the following check-ins: [103321e37a], [a8076aede3], [6d910245ad], [7c4cca6d1a], [edea3bb740], [1a6d4bb130], [a8c984c1d6], [69a493182f], and [1168763d2c]. (check-in: [46f406b2] user: drh branch: branch-3.6.22, size: 156905)
2010-02-23
17:36
[9269ec75] part of check-in [7c4cca6d] Remove the obsolete sqlite3SafetyOn() mechanism. Add additional logging output for CORRUPT, and CANTOPEN errors. (check-in: [7c4cca6d] user: drh branch: trunk, size: 156908)
2010-01-21
23:11
[1041ef11] part of check-in [a82e6b45] Fix a segfault that can occur when the LHS of a LIKE operator has an undefined collating sequence. Ticket [1258875e07553]. (check-in: [a82e6b45] user: drh branch: trunk, size: 156983)
2009-12-31
19:06
[43b11af0] part of check-in [6cf76c2a] Changes to remove warnings in MSVC build. (check-in: [6cf76c2a] user: shaneh branch: trunk, size: 156980)
2009-12-30
14:12
[62553021] part of check-in [cc6b959b] Adjustments to column cache handling in order to restore 100% branch test coverage. (check-in: [cc6b959b] user: drh branch: trunk, size: 156951)
2009-12-24
16:00
[5bf4b84d] part of check-in [ea4e57e1] Immediately purge entries from the column cache when the associated register undergoes an affinity change. Ticket [eb5548a849]. Enhance the SQLITE_TESTCTRL_OPTIMIZATIONS setting of sqlite3_test_control so that it can disable the column cache for testing purposes, in an effort to prevent future problems of a similar nature to this one. (check-in: [ea4e57e1] user: drh branch: trunk, size: 156948)
2009-12-16
23:28
[f20ee9a1] part of check-in [86734732] Fix for the "(x AND y) OR z" bug backported to version 3.6.21. (check-in: [86734732] user: drh branch: branch-3.6.21, size: 156951)
22:10
[5d057a10] part of check-in [2c2de252] Ensure WHERE clause terms involving tables on the right end of a join are not prematurely evaluated when tables on the left end of the join make use of the OR-clause optimization. Fix for ticket [31338dca7e]. (check-in: [2c2de252] user: drh branch: trunk, size: 157055)
2009-11-23
21:23
[11b5b00c] part of check-in [83dc7d38] Make sure registers computed for the VFilter opcode are marked invalid after the VFilter opcode finishes. Ticket [16fbf14cb2]. (check-in: [83dc7d38] user: drh branch: trunk, size: 154762)
2009-11-18
01:25
[6dedaffc] part of check-in [bf6c0bd1] Suppress more instances of unnecessary OP_IsNull and OP_Affinity opcodes. (check-in: [bf6c0bd1] user: drh branch: trunk, size: 154692)
2009-11-17
18:31
[ef0dbd39] part of check-in [ebb0c8a3] Code generator tries to avoid pointless OP_IsNull and OP_Affinity opcodes. (check-in: [ebb0c8a3] user: drh branch: trunk, size: 154729)
2009-11-16
22:54
[5a8ed388] part of check-in [929b6047] Fix a reference to freed memory that can occur following an OOM error in where.c. (check-in: [929b6047] user: drh branch: trunk, size: 153580)
2009-11-12
19:59
[d5c9692f] part of check-in [b9eab885] Enhance the OP_Found and OP_NotFound opcodes so that they can accept an array of registers as an unpacked record in addition to a record built using OP_MakeRecord. Use this to avoid OP_MakeRecord calls during IN expression processing. (check-in: [b9eab885] user: drh branch: trunk, size: 153698)
04:26
[c4ef4980] part of check-in [e8aec08b] Suppress unnecessary OP_Noop instructions on when the right table of a LEFT JOIN uses the index-only optimization. (check-in: [e8aec08b] user: drh branch: trunk, size: 153821)
2009-11-10
01:30
[29d33240] part of check-in [f6c045f6] Remove the obsolete "$Id:$" RCS identifier strings from the source code. (check-in: [f6c045f6] user: drh branch: trunk, size: 153751)
2009-11-01
19:26
[fac37876] part of check-in [cfa2db0f] Fix compiler warnings. Better comments on some variables associated with LIKE/GLOB processing in the query planner. (check-in: [cfa2db0f] user: drh branch: trunk, size: 153816)
2009-10-22
20:50
[3809a594] part of check-in [9854ad00] Add some sample requirement implementation comments to where.c. (check-in: [9854ad00] user: drh branch: trunk, size: 153525)
2009-10-19
22:41
[937fb6e4] part of check-in [3bcd78a1] Remove an unreachable condition in the WHERE clause processing of bound parameters and replace it with an assert(), for test coverage. (check-in: [3bcd78a1] user: drh branch: trunk, size: 152920)
18:11
[acf24024] part of check-in [2c50b3d5] Remove the sqlite3_reoptimize() API. The same functionality is now provided automatically to queries prepared using prepare_v2(). (check-in: [2c50b3d5] user: dan branch: trunk, size: 152776)
15:52
[9e8bb75c] part of check-in [6fe63711] When generating WHERE clause terms internally for NATURAL and USING joins, identify the table by its position in the FROM list, not by its name or alias. Fix for [b73fb0bd64]. (check-in: [6fe63711] user: dan branch: trunk, size: 152785)
2009-10-17
13:13
[896ec4cd] part of check-in [e74f8dc4] Make sure the target register is allocated before adding the bogus OP_Variable opcode in isLikeOrGlob(). Bugfix for the new sqlite3_reoptimize() logic. (check-in: [e74f8dc4] user: drh branch: trunk, size: 152751)
2009-10-15
18:35
[10b4796d] part of check-in [9bd6f3d8] Add the experimental sqlite3_reoptimize() API. (check-in: [9bd6f3d8] user: dan branch: experimental, size: 152650)
2009-09-21
16:34
[53e26209] part of check-in [cd850d49] Fix compilation with both OMIT_UTF16 and ENABLE_STAT2 defined. Ticket [56928bd084]. (check-in: [cd850d49] user: dan branch: trunk, size: 150362)
2009-09-09
16:10
[68db8ab9] part of check-in [f0c72a53] Suppress some harmless compiler warnings. (check-in: [f0c72a53] user: drh branch: trunk, size: 150320)
2009-09-07
04:38
[15b38ff1] part of check-in [26cd015c] Warning cleanup from the MSVC compile. (check-in: [26cd015c] user: shane branch: trunk, size: 150238)
2009-08-25
16:28
[a3218dfc] part of check-in [58db7e71] Remove an unreachable branch from where.c in order to restore 100% branch test coverage. Add assert() and testcase() macros to verify that the branch is unreachable. (check-in: [58db7e71] user: drh branch: trunk, size: 150231)
15:56
[fc8b33fb] part of check-in [3fb3686a] Initialize variables differently in the range processing logic of where.c in order to make sure variables are always initialized even following an OOM error. (check-in: [3fb3686a] user: drh branch: trunk, size: 150176)
2009-08-21
13:22
[b9ad2d2d] part of check-in [75f596a0] Change the expression code generator to account for the fact that the new sqlite3AtoF() never returns NaN. Also, clarification of a comment in where.c. (check-in: [75f596a0] user: drh branch: trunk, size: 150224)
2009-08-20
20:05
[ccd88f21] part of check-in [bbbee810] Simplifications to the range-scan logic in support of structural testing. (check-in: [bbbee810] user: drh branch: trunk, size: 150074)
18:14
[2d258a56] part of check-in [f0c24b5f] Continuing refinements of the range-scan optimizations in where.c. The range scores are changed from an integer 1..9 to 0..100. (check-in: [f0c24b5f] user: drh branch: trunk, size: 150066)
13:45
[02f2bb99] part of check-in [4a5d9550] Incremental code and comment cleanup in where.c. There is more to be done. (check-in: [4a5d9550] user: drh branch: trunk, size: 149009)
02:34
[e43ddc77] part of check-in [4ee44322] All the sqlite3GetCollSeq() function to specify an arbitrary text encoding. (check-in: [4ee44322] user: drh branch: trunk, size: 147129)
2009-08-19
08:18
[2e61e33f] part of check-in [362665e8] Add the SQLITE_ENABLE_STAT2 macro. If this is not defined at build-time, the stat2 table is not created, populated, or used. (check-in: [362665e8] user: dan branch: trunk, size: 147046)
2009-08-18
16:24
[9d4c2f17] part of check-in [ded9dec6] Change the sqlite_stat2 schema to be more flexible. (check-in: [ded9dec6] user: dan branch: trunk, size: 146943)
2009-08-17
17:06
[33a3aa8b] part of check-in [dd96bda2] First version of sqlite_stat2 (schema forces exactly 10 samples). (check-in: [dd96bda2] user: dan branch: trunk, size: 146803)
2009-08-13
19:21
[7573120c] part of check-in [e72186f2] If a binary operator in a WHERE clause that should be performed with no affinity conversions applied to its operands (see http://www.sqlite.org/datatype3.html) is optimized by index lookup, do not apply any conversions to the key value before looking it up in the index. Fix for [93fb9f89d6]. (check-in: [e72186f2] user: dan branch: trunk, size: 141023)
07:09
[53adef2c] part of check-in [19f799b3] Changes to the query planner that improve the order in which tables/indexes are scanned in join queries. (check-in: [19f799b3] user: dan branch: trunk, size: 138845)
2009-07-31
06:14
[7e696d69] part of check-in [8161af84] Fix a bug in where.c that could cause SQLite to write to freed memory while compiling a query with many terms in the WHERE clause. (CVS 6952) (check-in: [8161af84] user: danielk1977 branch: trunk, size: 137666)
2009-07-28
08:43
[de6ab601] part of check-in [614a8d83] Fixed reversed labels in WHERETRACE() statement. Debugging code only. (CVS 6948) (check-in: [614a8d83] user: shane branch: trunk, size: 137630)
2009-07-24
17:58
[bf56a85a] part of check-in [5d9e767a] Allow virtual tables to be used in shared-cache mode. (CVS 6928) (check-in: [5d9e767a] user: danielk1977 branch: trunk, size: 137636)
2009-06-16
14:15
[cf0d0917] part of check-in [793c93be] Fix a link error and warning that can occur in where.c when compiling under MSVC with SQLITE_OMIT_VIRTUALTABLE defined. Ticket #3914. (CVS 6767) (check-in: [793c93be] user: shane branch: trunk, size: 137560)
2009-06-15
16:27
[658d99d9] part of check-in [e1e64307] Fix compiler warnings with MSVC build. (CVS 6761) (check-in: [e1e64307] user: shane branch: trunk, size: 137477)
2009-06-11
17:04
[86fb1a3a] part of check-in [1fdb3e1e] Add an ALWAYS() to a conditional in where.c. (CVS 6747) (check-in: [1fdb3e1e] user: drh branch: trunk, size: 137460)
2009-06-10
19:33
[cbf29fc2] part of check-in [78a391dc] Do not let the reverse_unordered_selects pragma force the use of an index that would not otherwise be used. Ticket #3904. Also: remove an test which is always true. (CVS 6745) (check-in: [78a391dc] user: drh branch: trunk, size: 137453)
2009-06-08
19:44
[70440f8c] part of check-in [cc9c1217] Additional comments to clarify the operation of the LIKE optimizer in where.c. (CVS 6731) (check-in: [cc9c1217] user: drh branch: trunk, size: 137446)
17:11
[21555aa8] part of check-in [6b42dc3d] Clarification of the operation of the OR-term optimizer in where.c. (CVS 6730) (check-in: [6b42dc3d] user: drh branch: trunk, size: 137016)
2009-06-07
23:45
[01b8d473] part of check-in [a255c645] Disable the LIKE optimization if the affinity of the LHS column is not TEXT. Ticket #3901. (CVS 6727) (check-in: [a255c645] user: drh branch: trunk, size: 135140)
2009-06-06
15:17
[c6dda6e3] part of check-in [127b1398] Make sure the result of sqlite3VdbeGetOp() is not used as an array following an OOM error, since after (6691) it might be a single-entry dummy opcode. (CVS 6724) (check-in: [127b1398] user: drh branch: trunk, size: 135159)
2009-06-03
01:24
[706e9f2f] part of check-in [baea79fd] Additional changes to reduce stack usage. The SQLITE_SMALL_STACK compile-time option is now available. (CVS 6708) (check-in: [baea79fd] user: drh branch: trunk, size: 135139)
2009-05-28
01:00
[1a21128d] part of check-in [4ac2bdfb] Additional refinements to Expr handling. Restore compression of trigger expressions. Change Expr.zToken to Expr.u.zToken and added Expr.u.iValue. Remove an unnecessary ExprDup from CHECK constraint processing. And so forth. (CVS 6682) (check-in: [4ac2bdfb] user: drh branch: trunk, size: 135032)
2009-05-27
10:31
[145bb0d0] part of check-in [7cb1c3ba] Simplifications to the Expr object: Remove Expr.span completely and convert Expr.token into a char* Expr.zToken. Also simplify the Token object by removing the Token.dyn and Token.quoted fields. (CVS 6681) (check-in: [7cb1c3ba] user: drh branch: trunk, size: 135022)
2009-05-22
15:43
[d11b8a8c] part of check-in [fad88e71] Do not transform a WHERE clause of the form "a = ? OR a = ?" to "a IN (?, ?)" if "a" is a column of a virtual table. Ticket #3871. (CVS 6671) (check-in: [fad88e71] user: danielk1977 branch: trunk, size: 135261)
2009-05-06
19:03
[c5fa4a7a] part of check-in [93bdbc5e] Fix compiler warning found with gcc -Wextra. (CVS 6614) (check-in: [93bdbc5e] user: drh branch: trunk, size: 134730)
18:57
[f8e2e564] part of check-in [df599237] Changes to silence compiler warnings under MSVC. (CVS 6613) (check-in: [df599237] user: shane branch: trunk, size: 134809)
18:42
[31b1c577] part of check-in [37428435] Fix three variable initialization problems found by valgrind. (CVS 6612) (check-in: [37428435] user: drh branch: trunk, size: 134793)
2009-05-05
15:46
[6199249a] part of check-in [300da301] Make sure the left-shift operator never overflows. (CVS 6605) (check-in: [300da301] user: drh branch: trunk, size: 134757)
2009-05-01
21:13
[823891e1] part of check-in [12bcb03d] Record within the Token structure itself whether or not the token has been dequoted. This steals one bit from the length of a token and thus limits the size of tokens to 1GiB. (CVS 6589) (check-in: [12bcb03d] user: drh branch: trunk, size: 134713)
2009-04-29
11:50
[de8984ae] part of check-in [9664e2b6] Fix a case in where.c where a crash can follow a malloc failure. Also modify test code in test8.c to check a return code that was being dropped (causing a test in vtab_err.test to fail). (CVS 6567) (check-in: [9664e2b6] user: danielk1977 branch: trunk, size: 134680)
2009-04-24
15:46
[d20e083e] part of check-in [98606bee] Get rid of the special RowSet processing in where.c and move that into clients. Added the WHERE_DUPLICATES_OK option to eliminate an unnecessary RowSet during DELETE with a WHERE clause containing ORs. (CVS 6546) (check-in: [98606bee] user: drh branch: trunk, size: 134437)
14:51
[5eaf4422] part of check-in [207335fd] Make sure that the optimizer realizes that an "x IS NULL" contraint does not necessarily give a single-row result even on a UNIQUE index. Ticket #3824. (CVS 6545) (check-in: [207335fd] user: drh branch: trunk, size: 136165)
2009-04-23
13:22
[6f7199cf] part of check-in [dd4d67a6] Rework the column-cache mechanism to be more robust (and more correct). The column-alias cache is currently disabled, (CVS 6538) (check-in: [dd4d67a6] user: drh branch: trunk, size: 135832)
2009-04-22
17:15
[423ed1da] part of check-in [ecbef450] Eliminate the OP_VRowid opcode. The regular OP_Rowid now work for both regular and virtual tables. (CVS 6537) (check-in: [ecbef450] user: drh branch: trunk, size: 136058)
15:32
[576a21f6] part of check-in [1c508a99] Change the OP_Rowid opcode so that a deferred OP_Seek is pending, it simply pulls the rowid from the deferred seek target and does not actually move the cursor or do a seek. Other where.c cleanups. (CVS 6536) (check-in: [1c508a99] user: drh branch: trunk, size: 136246)
02:15
[48f711d2] part of check-in [e963bed0] Remove the rowhash object from the code. Rowset now fills its role. (CVS 6535) (check-in: [e963bed0] user: drh branch: trunk, size: 136411)
2009-04-21
17:23
[89436306] part of check-in [08e71b11] Fix a segfault that followed a malloc failure introduced by (6527). (CVS 6532) (check-in: [08e71b11] user: danielk1977 branch: trunk, size: 136634)
09:02
[2b580cc5] part of check-in [f61e4cd9] Attempt to optimize virtual table queries with 'OR' expressions in the WHERE clause. (CVS 6527) (check-in: [f61e4cd9] user: danielk1977 branch: trunk, size: 136597)
2009-04-07
13:48
[ddf26069] part of check-in [55b93649] Only enable WHERE-tracing when both TEST and DEBUG are enabled. (CVS 6463) (check-in: [55b93649] user: drh branch: trunk, size: 131014)
00:43
[70199494] part of check-in [567cf90b] Always enable WHERE-tracing on a test build. Oops - accidentally included a debugging change to pragma.c in this check-in. The real fix for the pragma problem is in the following checking. (CVS 6458) (check-in: [567cf90b] user: drh branch: trunk, size: 130989)
2009-04-06
12:26
[0eeb451e] part of check-in [d8c6b28a] Make sure the reverse_unordered_selects pragma works even on unindexed tables that are queried without a WHERE clause (CVS 6453) (check-in: [d8c6b28a] user: drh branch: trunk, size: 130970)
2009-03-29
00:15
[5a421d72] part of check-in [b601a575] Turn off the debugging macros in where.c - left on by mistake in the previous check-in. (CVS 6404) (check-in: [b601a575] user: drh branch: trunk, size: 130684)
00:13
[72b84f31] part of check-in [0c438e81] Improvements to cost estimation for evaluating the IN operator. Ticket #3757. (CVS 6403) (check-in: [0c438e81] user: drh branch: trunk, size: 130684)
2009-03-25
16:51
[d0a78f87] part of check-in [8589b0fc] Remove an unused parameter from sqlite3DequoteExpr. Fix another unrelated and harmless compiler warning. (CVS 6386) (check-in: [8589b0fc] user: drh branch: trunk, size: 129733)
2009-03-22
20:36
[55b13048] part of check-in [53149c9f] Allow the keyword INDEXED to be used as the name of a table or index or column - for backwards compatibility. (CVS 6370) (check-in: [53149c9f] user: drh branch: trunk, size: 129737)
2009-03-20
14:18
[42d3756d] part of check-in [093a0cf4] Make sure struct WhereClause is aligned on an 8-byte boundary. Fix for #3613, #3736. (CVS 6364) (check-in: [093a0cf4] user: danielk1977 branch: trunk, size: 129747)
2009-03-05
03:48
[ac555c8f] part of check-in [5477833e] Removed compiler warnings from MSVC builds. Ticket #3701. (CVS 6335) (check-in: [5477833e] user: shane branch: trunk, size: 129385)
2009-02-24
10:14
[ddc9074b] part of check-in [0e7c369c] Reverse commit (6315) for now. (CVS 6317) (check-in: [0e7c369c] user: danielk1977 branch: trunk, size: 129379)
2009-02-23
17:33
[591db2b9] part of check-in [294ba6f7] Scan an index instead of a table for "SELECT count(*) FROM <tbl>" queries. Because an index is usually smaller than a table on disk, this saves some IO. (CVS 6315) (check-in: [294ba6f7] user: danielk1977 branch: trunk, size: 129888)
16:52
[72980baa] part of check-in [bc078e00] Add the reverse_unordered_selects pragma. (CVS 6314) (check-in: [bc078e00] user: drh branch: trunk, size: 129337)
2009-02-20
10:58
[de921742] part of check-in [e43ed649] Instead of using SetNumColumns, specify the number of columns in a table or index using the P4 argument. (CVS 6310) (check-in: [e43ed649] user: danielk1977 branch: trunk, size: 128619)
2009-02-19
14:39
[2284de47] part of check-in [d9f6ffbc] Changes to reduce the heap space consumed by triggers, views and tables in the in-memory representation of the schema. Also to reduce the space used by prepared statements slightly. (CVS 6305) (check-in: [d9f6ffbc] user: danielk1977 branch: trunk, size: 128667)
2009-02-04
03:59
[63bb7527] part of check-in [5cef4000] Changes to completely remove all floating point ops if SQLITE_OMIT_FLOATING_POINT defined. Note that w/o fp, date/time, round, nan, etc. are all gone or limited in functionality. Updated some of the test scripts to support missing fp and 64-bit functionality. Ticket #3029. (CVS 6250) (check-in: [5cef4000] user: shane branch: trunk, size: 128342)
01:49
[fb89dfb2] part of check-in [6301f08a] Remove compiler warnings under MSVC. (CVS 6249) (check-in: [6301f08a] user: shane branch: trunk, size: 127987)
2009-01-30
05:40
[ac21a2bc] part of check-in [c74c78e4] Minor changes to remove a few MSVC compiler warnings at /W3. Ticket #3610. (CVS 6215) (check-in: [c74c78e4] user: shane branch: trunk, size: 127987)
2009-01-24
09:56
[48249767] part of check-in [f3c09a0c] Remove incorrect ALWAYS macro associated with empty IN() sets. Ticket #3602. (CVS 6202) (check-in: [f3c09a0c] user: danielk1977 branch: trunk, size: 127989)
2009-01-14
00:55
[e9a37def] part of check-in [d28b5820] Make sure the OR-clause optimizer takes the cost of sorting into account. Reset the rowid cache on the OP_Rewind and OP_Last opcodes. Bump the version number so that we can do an emergency release. Ticket #3581. (CVS 6173) (check-in: [d28b5820] user: drh branch: trunk, size: 127989)
2009-01-10
15:34
[bd4fef17] part of check-in [3da55787] Fix a bug caused by overzealous code test coverage simplifications. Bug found by TH3. (CVS 6157) (check-in: [3da55787] user: drh branch: trunk, size: 127786)
2009-01-09
02:49
[8259ee36] part of check-in [6e171c0a] More coverage improvements. (CVS 6148) (check-in: [6e171c0a] user: drh branch: trunk, size: 127731)
2009-01-08
21:00
[86cd4009] part of check-in [1e5725c5] Increased test coverage in where.c. (CVS 6146) (check-in: [1e5725c5] user: drh branch: trunk, size: 127731)
03:11
[c67797ea] part of check-in [4b2c08e8] Increase test coverage of where.c. Make sure OR-optimization works on UPDATE and DELETE in addition to SELECT. (Bug found by coverage tests.) (CVS 6139) (check-in: [4b2c08e8] user: drh branch: trunk, size: 127790)
2009-01-07
20:58
[92ef9d96] part of check-in [2e1ab51f] Add new test cases to increase coverage of where.c. (CVS 6138) (check-in: [2e1ab51f] user: drh branch: trunk, size: 127648)
18:24
[9852acec] part of check-in [fe90e911] Fix a bug in the LIKE query optimization. (Found by coverage testing.) (CVS 6137) (check-in: [fe90e911] user: drh branch: trunk, size: 127592)
2009-01-06
14:19
[ad9d49f7] part of check-in [da770a8d] Fix compiler warnings. (CVS 6117) (check-in: [da770a8d] user: drh branch: trunk, size: 127309)
00:08
[0b2eb969] part of check-in [a7015625] Fix a problem in the WHERE clause generator when the FROM clause is empty. (CVS 6114) (check-in: [a7015625] user: drh branch: trunk, size: 127424)
2008-12-30
17:55
[b25a7ecf] part of check-in [b090d573] Fix a bug in the multi-index OR cost estimator. Remove leftover "breakpoint" commands from test scripts. (CVS 6086) (check-in: [b090d573] user: drh branch: trunk, size: 127424)
16:18
[bb4f4f60] part of check-in [4b646022] Get EXPLAIN QUERY PLAN working with the multi-index OR optimization. Added new test script "where9.test". (CVS 6084) (check-in: [4b646022] user: drh branch: trunk, size: 127241)
15:26
[44df523c] part of check-in [ac28aa8b] Add a few more tests to where8.test. (CVS 6081) (check-in: [ac28aa8b] user: danielk1977 branch: trunk, size: 127116)
12:00
[924e77c6] part of check-in [35c87585] Add a couple of extra tests for the "WHERE ... OR" optimization. (CVS 6077) (check-in: [35c87585] user: danielk1977 branch: trunk, size: 127141)
09:45
[1e1cadcf] part of check-in [f8ff0212] Fix a bug in where.c causing a malfunction when an INDEXED BY clause specified an unusable index on other than the leftmost table in the FROM clause. Ticket #3560. (CVS 6076) (check-in: [f8ff0212] user: danielk1977 branch: trunk, size: 127216)
2008-12-29
23:45
[d0f422dd] part of check-in [7d0ae55d] Always make sure WhereClause objects are initialized to zero when they are first allocated. (CVS 6073) (check-in: [7d0ae55d] user: drh branch: trunk, size: 127105)
18:33
[90b1fa8a] part of check-in [bff460ec] Add test file where8.test. (CVS 6072) (check-in: [bff460ec] user: danielk1977 branch: trunk, size: 127112)
14:51
[a102f06e] part of check-in [0b972f14] Remove an old variable declaration that was commented out using a C++ comment. (CVS 6071) (check-in: [0b972f14] user: danielk1977 branch: trunk, size: 127113)
2008-12-28
20:47
[29c57ed5] part of check-in [3464d369] Multi-index OR optimizer response to ORDER BY rowid. But fix in sqlite3_stmt_status(): report a full table scan when "ORDER BY rowid" is used without constraints. (CVS 6069) (check-in: [3464d369] user: drh branch: trunk, size: 127185)
18:35
[4050b918] part of check-in [67cf24b3] Optimize WHERE clauses that constain AND, BETWEEN, and LIKE terms as operands of an OR. (CVS 6068) (check-in: [67cf24b3] user: drh branch: trunk, size: 126950)
16:55
[f41330e7] part of check-in [fa95f843] Simplify the VM code that implements WHERE claues. (CVS 6067) (check-in: [fa95f843] user: drh branch: trunk, size: 125876)
2008-12-24
11:25
[b273a232] part of check-in [c6fd3b8f] Fix a virtual table related assert() that can fail following a malloc failure. (CVS 6064) (check-in: [c6fd3b8f] user: danielk1977 branch: trunk, size: 125456)
2008-12-23
23:56
[ef69833c] part of check-in [55d4f493] Continuing improvements to the multi-index OR-clause optimizer. Added a few simple test cases. (CVS 6062) (check-in: [55d4f493] user: drh branch: trunk, size: 125338)
16:23
[3f4e8020] part of check-in [d2105f61] Fix an OOM problem in where.c. (CVS 6060) (check-in: [d2105f61] user: drh branch: trunk, size: 122645)
13:35
[50e47032] part of check-in [d77a7023] Multi-index OR-clause optimization now works for simple tests. There are no test scripts for it yet, though. And it is disabled by default, pending further testing and optimization. We need a lot of both. (CVS 6058) (check-in: [d77a7023] user: drh branch: trunk, size: 122598)
2008-12-21
03:51
[6e5de242] part of check-in [778e91dd] Continue refactoring where.c in preparation for installing OR-clause optimizations. (CVS 6050) (check-in: [778e91dd] user: drh branch: trunk, size: 121117)
2008-12-20
02:06
[d373103e] part of check-in [c3f7aa01] Enhanced analysis of OR terms in a WHERE clause. Another step toward being able to use indices with OR-connected WHERE clause terms. (CVS 6045) (check-in: [c3f7aa01] user: drh branch: trunk, size: 118258)
2008-12-17
19:22
[685a1e8d] part of check-in [78401b33] Update the WHERE clause processing infrastructure in preparation for adding multi-index OR evaluation. (CVS 6037) (check-in: [78401b33] user: drh branch: trunk, size: 112590)
2008-12-12
17:56
[0ef44949] part of check-in [e545490a] Rework the rowid lookup logic in the query optimizer to fix various boundary value problems. Ticket #3536. Renamed the OP_MoveXX opcodes to OP_SeekXX. (CVS 6024) (check-in: [e545490a] user: drh branch: trunk, size: 109200)
2008-12-10
19:26
[7c6ab881] part of check-in [c872d554] Never use strlen(). Use our own internal sqlite3Strlen30() which is guaranteed to never overflow an integer. Additional explicit casts to avoid nuisance warning messages. (CVS 6007) (check-in: [c872d554] user: drh branch: trunk, size: 109084)
2008-12-09
01:32
[c5a21be6] part of check-in [680755db] Fix compiler warnings in where.c and in the TCL test harness. (CVS 5994) (check-in: [680755db] user: drh branch: trunk, size: 109066)
2008-12-08
21:37
[538cbf21] part of check-in [6ed696e7] Some minor name refactoring in where.c. Avoid declaring variables before initializing them in the amalgamation because VC++ doesn't like that. (CVS 5993) (check-in: [6ed696e7] user: drh branch: trunk, size: 108965)
2008-12-05
17:17
[d2761121] part of check-in [adedd697] Fix harmless compiler warnings. Improved comments in the query optimizer. (CVS 5982) (check-in: [adedd697] user: drh branch: trunk, size: 108803)
15:24
[78ecad37] part of check-in [46f2d089] Make use of sqlite3DbMallocSize to maximize the size of growable buffers after each reallocation. Added new comments and testcase() macros to where.c. (CVS 5981) (check-in: [46f2d089] user: drh branch: trunk, size: 108794)
02:36
[ef2a149b] part of check-in [81bd0b5c] Variable name changes in the query optimizer for disambiguation and clarification. Clear space in boolean vectors for new bit values to encode new query plan templates. (CVS 5980) (check-in: [81bd0b5c] user: drh branch: trunk, size: 107774)
2008-11-17
19:18
[96f7c2bd] part of check-in [8009220c] Modifications to avoid unsigned/signed comparisons in various files. (CVS 5914) (check-in: [8009220c] user: danielk1977 branch: trunk, size: 107275)
16:42
[40a5c31c] part of check-in [f35606d1] Modifications to avoid unsigned/signed comparisons in where.c. (CVS 5913) (check-in: [f35606d1] user: danielk1977 branch: trunk, size: 107387)
2008-11-03
09:06
[171c9b25] part of check-in [6c918c4e] Fix a bug reported on the mailing list triggered by the pattern "SELECT
2008-10-25
15:03
[1853c1bf] part of check-in [1fa3bbd8] Disable the result-set alias cache when on conditional code branches. Ticket #3461. The column cache and result set alias cache mechanisms are prone to this kind of error and need to be refactored. This check-in should be considered a temporary fix in advance of a more general redesign of the whole mechanism. (CVS 5841) (check-in: [1fa3bbd8] user: drh branch: trunk, size: 106922)
2008-10-11
16:47
[76bc0a7a] part of check-in [d2c252d6] Fix a memory leak on ORDER BY of a compound select caused by the resolver on a flattened query. Also fix a OOM segfault in WHERE clause processing. (CVS 5801) (check-in: [d2c252d6] user: drh branch: trunk, size: 106823)
2008-10-07
23:46
[53d495de] part of check-in [de473efb] Add the experimental sqlite3_stmt_status() interface. (CVS 5781) (check-in: [de473efb] user: drh branch: trunk, size: 106840)
2008-10-06
05:32
[da2a0e13] part of check-in [98ca5580] Allow INDEXED BY and NOT INDEXED clauses in SELECT statements. (CVS 5766) (check-in: [98ca5580] user: danielk1977 branch: trunk, size: 106754)
2008-10-01
08:43
[75b7f45b] part of check-in [59d2e89e] Fix a bug in where.c where a non-temp register was being incorrectly deallocated. Ticket #3408. (CVS 5758) (check-in: [59d2e89e] user: danielk1977 branch: trunk, size: 105387)
2008-09-06
14:19
[a9958b26] part of check-in [7c0f638e] Deallocate a temp register allocated by codeEqualityTerm() in where.c. If it is not deallocated, its value may be reused by the column-cache mechanism. However, by the time it is used, the value may have been clobbered by a sub-routine that also uses the same temp register. Fix for #3357. (CVS 5679) (check-in: [7c0f638e] user: danielk1977 branch: trunk, size: 105387)
2008-08-25
12:08
[72a4ac68] part of check-in [635933b1] Two if statements should be asserts. GCC was silently ignoring them, hence the problem did not show up in coverage testing. Ticket #3333. (CVS 5607) (check-in: [635933b1] user: drh branch: trunk, size: 105338)
2008-08-20
16:35
[b156f278] part of check-in [daf730d1] Refactor the name resolution procedures in the code generator. (CVS 5569) (check-in: [daf730d1] user: drh branch: trunk, size: 105330)
2008-08-01
17:37
[a800184a] part of check-in [007359b7] Test that virtual table methods xBestIndex, xOpen, xFilter, xNext, xColumn, xRowid, xUpdate, xSync and xBegin can all return error messages using the sqlite3_vtab.zErrMsg variable. (CVS 5519) (check-in: [007359b7] user: danielk1977 branch: trunk, size: 105063)
2008-07-28
19:34
[ee4878e4] part of check-in [e48f9697] Implement the "lookaside" memory allocation cache. Use of this cache makes the speed1.test script run about 15% faster. Added new interfaces to control the cache. (CVS 5488) (check-in: [e48f9697] user: drh branch: trunk, size: 104884)
2008-07-12
14:52
[e4c40d22] part of check-in [dcb16024] Remove leftover debugging commands (breakpoint and btree_breakpoint) from test scripts. (CVS 5400) (check-in: [dcb16024] user: drh branch: trunk, size: 104685)
2008-07-11
16:15
[087bfd37] part of check-in [d7e2f0d2] Additional test coverage for the btree module. Remove the failsafe() macro and replace it with ALWAYS() and NEVER(). (CVS 5395) (check-in: [d7e2f0d2] user: drh branch: trunk, size: 104672)
2008-07-09
13:28
[3324f827] part of check-in [8aae4fe7] Begin adding the failsafe() macro. (CVS 5383) (check-in: [8aae4fe7] user: drh branch: trunk, size: 104756)
2008-07-08
22:28
[e8a241aa] part of check-in [6cdb6841] Added macros to convert between 32-bit ints and 64-bit ptrs to avoid compiler warnings. (CVS 5378) (check-in: [6cdb6841] user: shane branch: trunk, size: 104645)
19:45
[013a14f8] part of check-in [1ed98f9e] Fix a bug in where.c introduced by check-in (5373). (CVS 5375) (check-in: [1ed98f9e] user: drh branch: trunk, size: 104619)
18:05
[1422d956] part of check-in [fa07c360] Improved testing of the min/max optimization. (CVS 5373) (check-in: [fa07c360] user: drh branch: trunk, size: 104638)
2008-06-26
18:04
[6a22ceb8] part of check-in [d45a97be] Fix handling of "x IN (...)" and "x NOT IN (...)" expressions when the set contains an SQL NULL value. (CVS 5314) (check-in: [d45a97be] user: danielk1977 branch: trunk, size: 104582)
2008-06-25
02:47
[767db25b] part of check-in [e53403b6] If a unique index covers any prefix of the ORDER BY clause then let it satisfy the ORDER BY clause. (CVS 5301) (check-in: [e53403b6] user: drh branch: trunk, size: 104574)
2008-06-15
02:51
[5c4a999f] part of check-in [65fe7b62] Continuing work on the new memory allocation subsystem. Added routines for temporary memory allocation. Right the btree balance mechanism to only do one temporary allocation at a time. (CVS 5220) (check-in: [65fe7b62] user: drh branch: trunk, size: 104456)
2008-06-12
00:07
[6af9313b] part of check-in [14a9b945] Additional refinements to the new sqlite3_initialize() interface design. (CVS 5206) (check-in: [14a9b945] user: drh branch: trunk, size: 104457)
2008-05-30
14:58
[53c6b801] part of check-in [7cadb223] Fix typos in comments in where.c. (CVS 5180) (check-in: [7cadb223] user: drh branch: trunk, size: 104456)
2008-05-29
05:23
[ad88aefa] part of check-in [5f6eab65] Fix cosmetic issues spotted while working on ticket #3146 (CVS 5177) (check-in: [5f6eab65] user: drh branch: trunk, size: 104453)
2008-05-28
18:01
[d074da73] part of check-in [c81efc97] Use %llx instead of %x for 64 bit values (this only affects a debugging statement). (CVS 5170) (check-in: [c81efc97] user: shane branch: trunk, size: 104379)
2008-05-26
18:33
[8c8b360d] part of check-in [33548744] Fix the LIKE query optimizer so that it works with LIKE patterns ending in '@%' on NOCASE columns. Ticket #3139. (CVS 5158) (check-in: [33548744] user: drh branch: trunk, size: 104376)
2008-05-16
15:40
[ef5bd7ad] part of check-in [ecbc0d5d] Disable the column cache when coding values that will be passed to the xFilter() method of a virtual table, in case the xFilter() implementation modifies the type or encoding of the value. Ticket #3121. (CVS 5139) (check-in: [ecbc0d5d] user: danielk1977 branch: trunk, size: 104425)
2008-04-19
14:40
[85719d58] part of check-in [adcef73b] Comment and variable-name cleanup in where.c. Add testcase() macros to insure adequate test coverage of table-driven logic. (CVS 5032) (check-in: [adcef73b] user: drh branch: trunk, size: 104351)
2008-04-18
10:25
[011f866c] part of check-in [9a976819] Combine cases 3 and 4 in where.c, since case 4 is now a special case of case 3. (CVS 5029) (check-in: [9a976819] user: danielk1977 branch: trunk, size: 102854)
09:01
[e6850aa2] part of check-in [c448f15a] Allow OP_MoveGt and similar to use an array of registers instead of a serialized record. Modify one type of index range scan to use this. (CVS 5028) (check-in: [c448f15a] user: danielk1977 branch: trunk, size: 105469)
2008-04-17
19:14
[4835f36b] part of check-in [0d2e258e] Additional work on ticket #3015. The previous fix (check-in (4919)) did not appear to work in all cases and it disabled indexing in some places where it should not have. New test cases added to help insure that the current fix is better. (CVS 5026) (check-in: [0d2e258e] user: drh branch: trunk, size: 105658)
2008-04-10
13:33
[a686f1e0] part of check-in [fba97f78] First cut at optimizing single-row updates to use a one-pass algorithm. (CVS 4973) (check-in: [fba97f78] user: drh branch: trunk, size: 105487)
2008-04-01
05:07
[86b042dc] part of check-in [91cc646e] Fix the CSE mechanism so that it takes into account column affinity changes that might be imposed by comparison operators. (CVS 4949) (check-in: [91cc646e] user: drh branch: trunk, size: 104895)
2008-03-31
23:48
[811fd1e5] part of check-in [c29ee0fe] Avoid duplicate OP_Column opcodes by remembering prior results. This is similar to CSE, but only applies to columns. (CVS 4943) (check-in: [c29ee0fe] user: drh branch: trunk, size: 104907)
18:19
[902ddf1e] part of check-in [2126db39] Factor constant subexpressions out of loops. (CVS 4942) (check-in: [2126db39] user: drh branch: trunk, size: 104586)
2008-03-28
19:16
[dc146152] part of check-in [39705b61] Fix a problem with min() and descending indexes. (CVS 4933) (check-in: [39705b61] user: danielk1977 branch: trunk, size: 104294)
18:11
[aa7ca845] part of check-in [bce28975] Fix for #3022. Handle queries like "SELECT min(b) FROM T WHERE a = X AND b > X" when there is an index on (a,b). (CVS 4930) (check-in: [bce28975] user: danielk1977 branch: trunk, size: 104285)
2008-03-26
14:56
[7aeeec67] part of check-in [3fafa562] Make sure ON clause terms of a LEFT JOIN are not used with an index on the right table of the join. Ticket #3015. (CVS 4919) (check-in: [3fafa562] user: drh branch: trunk, size: 104269)
2008-03-25
09:47
[f18bac2f] part of check-in [04715364] Use a vdbe memory cell to allocate the space required for vdbe cursors. (CVS 4912) (check-in: [04715364] user: danielk1977 branch: trunk, size: 103214)
2008-03-17
17:08
[78d6689d] part of check-in [9d2afbb5] Abandon the OR optimization following a memory allocation failure, to avoid referencing uninitialized memory. (CVS 4872) (check-in: [9d2afbb5] user: drh branch: trunk, size: 103212)
09:36
[dd72c822] part of check-in [ffd47027] Return an error when an xBestIndex() method indicates that it intends to use the value of an unusable constraint. Related to #2998. (CVS 4867) (check-in: [ffd47027] user: danielk1977 branch: trunk, size: 103171)
2008-03-04
17:45
[c5eaca1f] part of check-in [9c6694bb] Various renames & cleanups to limit exported symbols on amalgamation build (CVS 4819) (check-in: [9c6694bb] user: mlcreech branch: trunk, size: 102923)
2008-02-23
21:55
[f899a98f] part of check-in [610574b2] Fix a bug in the LIKE optimizer that occurs when the last character before the wildcard is an upper-case 'Z'. Ticket #2959. (CVS 4807) (check-in: [610574b2] user: drh branch: trunk, size: 102926)
2008-01-23
12:52
[7ff0ca02] part of check-in [9f95d79d] Improvements to test coverage in the lemon-generated parser and in the sqlite3_get_table() interface. (CVS 4745) (check-in: [9f95d79d] user: drh branch: trunk, size: 102342)
03:03
[b6c296c5] part of check-in [5375ad6b] Make sqlite3SafetyOn() and sqlite3SafetyOff() macros which disappear when compiling without -DSQLITE_DEBUG=1. (CVS 4744) (check-in: [5375ad6b] user: drh branch: trunk, size: 102665)
2008-01-19
20:11
[0c18a6d8] part of check-in [af129b6d] Miscellaneous code simplifications and cleanup and test coverage enhancements. (CVS 4730) (check-in: [af129b6d] user: drh branch: trunk, size: 102702)
2008-01-17
16:22
[0cc6052f] part of check-in [706b41b7] Registerification of the VDBE is complete. The operand stack has been removed from the code. All instructions operate out of registers only. (CVS 4718) (check-in: [706b41b7] user: drh branch: trunk, size: 102660)
02:36
[75908cb6] part of check-in [b3a141b2] Registerification of the WHERE clause logic. (CVS 4716) (check-in: [b3a141b2] user: drh branch: trunk, size: 102708)
2008-01-12
19:03
[27e40d32] part of check-in [426f31ec] Continuing work toward converting the VM to a register machine. (CVS 4708) (check-in: [426f31ec] user: drh branch: trunk, size: 102164)
2008-01-09
23:04
[9705df3c] part of check-in [e3cf1c1c] All essential opcodes can now operate out of registers and completely avoid the stack. Many still optionally use the stack to support legacy code generation, but the stack is not required. The next step is to update all code generation to avoid using the stack. (CVS 4700) (check-in: [e3cf1c1c] user: drh branch: trunk, size: 102208)
02:15
[8c2bedcc] part of check-in [92deff07] Continued work toward converting to a register-based VM. (CVS 4698) (check-in: [92deff07] user: drh branch: trunk, size: 102209)
2008-01-08
23:54
[8f55e725] part of check-in [8862ce9c] Registerify the comparison opcodes. (CVS 4697) (check-in: [8862ce9c] user: drh branch: trunk, size: 102224)
2008-01-07
19:20
[306fafa7] part of check-in [aa48867c] Registerify the AUTOINCREMENT processing and the OP_IsNull and OP_NotNull operators. (CVS 4692) (check-in: [aa48867c] user: drh branch: trunk, size: 102127)
2008-01-05
17:39
[0d72b643] part of check-in [c449e04f] First pass at optimizing max()/min() as described in #2853. Some refinements to come. (CVS 4687) (check-in: [c449e04f] user: danielk1977 branch: trunk, size: 102110)
05:38
[941635bb] part of check-in [32380dca] Register-ify the OP_ForceInt opcode. (CVS 4684) (check-in: [32380dca] user: drh branch: trunk, size: 100181)
04:06
[af005c6a] part of check-in [cc149eb9] Get rid of OP_Dup, OP_MemStore, OP_MemLoad, and OP_MemMove. Replace with OP_Copy, OP_SCopy, and OP_Move. Add the infrastructure for operation properties in1, in2, in3, out2, and out3 but do not yet use any of these. (CVS 4682) (check-in: [cc149eb9] user: drh branch: trunk, size: 100148)
2008-01-04
22:01
[d015536e] part of check-in [fe057a88] Implement the out2-prerelease opcode design pattern. (CVS 4681) (check-in: [fe057a88] user: drh branch: trunk, size: 100180)
2008-01-03
23:44
[ce1e6c53] part of check-in [61bfb77c] Change the sqlite3ExprCode() function so that callers can request that the result of the expression be left on the stack or in a register. (CVS 4673) (check-in: [61bfb77c] user: drh branch: trunk, size: 100176)
18:39
[10c0616d] part of check-in [253ed40a] Modify VFilter and VRename to use registers instead of the vdbe stack for inputs. (CVS 4670) (check-in: [253ed40a] user: danielk1977 branch: trunk, size: 100166)
18:03
[f02ecb55] part of check-in [0b849805] Registers (aka memory cells) in the VM are now numbered starting with 1 instead of 0. A register number of 0 means "no such register". (CVS 4669) (check-in: [0b849805] user: drh branch: trunk, size: 100012)
07:54
[6b1d4acf] part of check-in [35da261d] Change OP_OpenRead and OP_OpenWrite so that the database number is read from the P3 operand, not the stack. (CVS 4663) (check-in: [35da261d] user: danielk1977 branch: trunk, size: 100062)
00:01
[09edd04e] part of check-in [027875e4] Refactoring the VM. The P3 parameter is changed to P4. A P5 parameter is added (though not currently used.) Add routines sqlite3VdbeAddOpX() where X is one of 0, 1, 2, 3, or 4. (CVS 4660) (check-in: [027875e4] user: drh branch: trunk, size: 100100)
2008-01-02
00:34
[49901aac] part of check-in [051ec01f] Begin setting a foundation on which to convert the VM from a stack-based to a register-based machine. Everything is still mostly stack based with this check-in. This change merely begins adding infrastructure to support a register-based architecture. (CVS 4652) (check-in: [051ec01f] user: drh branch: trunk, size: 99985)
2007-12-12
17:42
[4d71db7e] part of check-in [12c3029b] Try to find some more stack leaks by adding OP_StackDepth to loops in DML statements. None were found. (CVS 4617) (check-in: [12c3029b] user: danielk1977 branch: trunk, size: 100001)
2007-11-29
17:43
[7ec7c7a5] part of check-in [061608c7] When using an index to scan a database table, read column data from the index in preference to the table. This increases the likelihood that the table will not be required at all. (CVS 4580) (check-in: [061608c7] user: danielk1977 branch: trunk, size: 99954)
17:05
[a03cd9da] part of check-in [56d0e326] Optimisations for expressions of the form "<value> IN (SELECT <column> FROM )". (CVS 4579)
(check-in: [56d0e326] user: danielk1977 branch: trunk, size: 99750)
2007-11-26
13:36
[82e2cb76] part of check-in [5e02dbab] Additional out-of-memory testing. Fix bugs caused by malloc failures in where.c. Tickets #2794, #2795, #2796, and #2797. (CVS 4560) (check-in: [5e02dbab] user: drh branch: trunk, size: 99664)
2007-11-05
05:12
[ddcbc5c4] part of check-in [7027368c] Handle "IS NULL" constraints on virtual table scans. IS NULL constraints are not passed to the virtual table layer. Ticket #2759. (CVS 4523) (check-in: [7027368c] user: danielk1977 branch: trunk, size: 99574)
2007-09-13
17:54
[44042c8b] part of check-in [2cfdbfe6] Fix incorrect index cost assumptions that occur after an ANALYZE. Ticket #2643. (CVS 4424) (check-in: [2cfdbfe6] user: drh branch: trunk, size: 99466)
2007-09-12
15:41
[1b3a67bb] part of check-in [9c9c2a1d] In the query optimizer, make sure table dependencies from all terms of a compound SELECT statement are recognized so that subqueries in a WHERE clause are not evaluated too early. Fix for ticket #2640. (CVS 4422) (check-in: [9c9c2a1d] user: drh branch: trunk, size: 99486)
2007-08-29
14:06
[4687a2a5] part of check-in [c790c234] Use the DbMalloc() and DbRealloc() functions more consistently. (CVS 4323) (check-in: [c790c234] user: danielk1977 branch: trunk, size: 99491)
12:31
[beade77e] part of check-in [e38ef81b] Modifications to the malloc failure tests to test transient and persistent failures. (CVS 4321) (check-in: [e38ef81b] user: danielk1977 branch: trunk, size: 99514)
2007-08-16
11:36
[2776a0ca] part of check-in [5e2795d0] Fix some more small problems introduced by recent refactoring. (CVS 4235) (check-in: [5e2795d0] user: danielk1977 branch: trunk, size: 99502)
10:09
[b5af6231] part of check-in [77b16713] More work on refactoring of malloc() interfaces. There are still many errors. (CVS 4233) (check-in: [77b16713] user: danielk1977 branch: trunk, size: 99499)
04:30
[366bfb2b] part of check-in [deb7ecd6] Half-way through a major refactoring of the memory allocation. I have not even attempted to compile so I am certain there are countless errors. (CVS 4231) (check-in: [deb7ecd6] user: drh branch: trunk, size: 99441)
2007-07-30
14:40
[c7e13b81] part of check-in [7b699686] Fix a bug with explicit collation sequences attached to a column reference expression that is on the right-hand-side of a binary comparison operator. (CVS 4187) (check-in: [7b699686] user: danielk1977 branch: trunk, size: 99146)
2007-06-11
12:56
[12387641] part of check-in [abf64d1d] Fix a bug in the LIKE optimization that was causing the pattern string to be dequoted twice. Ticket #2407. (CVS 4056) (check-in: [abf64d1d] user: drh branch: trunk, size: 98440)
2007-06-08
08:39
[b5e7a973] part of check-in [11ee8ea4] Make sure rowid comparisons against NULL work correctly. Ticket #2404. (CVS 4050) (check-in: [11ee8ea4] user: drh branch: trunk, size: 98406)
00:20
[6a3c44fe] part of check-in [46fdd195] Fix the query optimizer so that it correctly handles constant expressions in the ON clause of a LEFT JOIN. Ticket #2403. (CVS 4049) (check-in: [46fdd195] user: drh branch: trunk, size: 98400)
2007-06