Commit Graph

18 Commits

Author SHA1 Message Date
drh
21571a94c1 An index on the expression "likely(X)" should store the true value of X,
even if X is a real number with no fractional part.  The optimization of
storing some REAL indexed values as INT (see [10d851353c2abead]) should
be omitted for index columns that are expressions.
[forum:/forumpost/3b940c437a|Forum post 3b940c437a].

FossilOrigin-Name: 791473bc6677c2ae76f558082a4b43ca1eaf9895b76624d5b55d58f2af898ff3
2021-06-14 14:00:09 +00:00
dan
9988db8302 Fix a bad interaction between constant propagation and transitive term handling causing patterns like "WHERE unlikely(t1.x=t1.y) AND t1.y=?" to return non-matching rows.
FossilOrigin-Name: 2363a14ca723c0343fbe350f6c19787a7a47c2289fd9af136c97a451b53b5226
2021-04-15 19:09:19 +00:00
drh
8210233c7b Revise tests cases to align with the new EXPLAIN QUERY PLAN output.
FossilOrigin-Name: 50fbd532602d2c316813046ed6be8be2991c281eb5f295c4c28520a0de73862c
2021-03-20 15:11:29 +00:00
drh
461ff3594b Test case updates.
FossilOrigin-Name: 27c681c9c6672ad7098d8ff2c41e76d3e9e55866b6327ed85e73f63bd623ceed
2020-10-22 18:16:17 +00:00
drh
86d2de2571 Check-in [1d4f86201dab9a22] changed a testcase() to an assert() because we
didn't know how to reach that condition any more.  But YongHeng's fuzzer
found a way.  So now we change it back.  Ticket [9fb26d37cefaba40].

FossilOrigin-Name: 90b1169d1b200d35a3f9f0ad2ae35a1b336bdd9b1ad0494ba80a382354c8d8b8
2020-06-14 13:40:13 +00:00
drh
02ff747bc0 The OP_ResultRow opcode releases the SCopy dependences on all its registers,
as the values in those registers will not be reused.

FossilOrigin-Name: 1dc83c5d54ca2890112e735e336c209adb8d067d2f647e9f8ae5d58f84a52461
2019-12-31 12:18:24 +00:00
drh
0d950af311 Fix the likely(), unlikely(), and likelihood() functions so that they have
no affinity, just like any other function.
Ticket [7e07a3dbf5a8cd26]

FossilOrigin-Name: 44578865fa7baf9760e355691ca9ce753295aaba7a4ee0bba29d4f85d9335bab
2019-08-22 16:38:42 +00:00
drh
b3f0276b9e 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.

FossilOrigin-Name: 5f0e803e33aa557865d5fc830d9202d628de9a94c9757058ca48f1a560702cd3
2018-05-02 18:00:17 +00:00
drh
5f02ab0976 Make sure that the likelihood() function does not mess up generation of
result-set code when it is used (inappropropriately) in a result-set 
expression.

FossilOrigin-Name: 7cdbae625eb029538a693d2bebec465a6f65fb90
2015-06-20 13:18:34 +00:00
drh
606f2344e9 Pervent the likelihood() function from moving ON clause terms of a LEFT JOIN
into the WHERE clause.
Fix for ticket [5f60b11fc8e23490e2]

FossilOrigin-Name: ed96e14adce4a4f94cc6838c46bc97937c4cb72a
2015-06-18 14:32:51 +00:00
drh
03202a97f8 Add the likely() function for symmetry with unlikely(). The likely(X)
function means the same thing as likelihood(X,0.9375).

FossilOrigin-Name: 38965484199153e3e5b999f5196c1d66e5296f60
2014-06-17 16:11:28 +00:00
dan
8ad1d8ba38 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.
FossilOrigin-Name: c51efaa5d29ee0a91b9e6a83a8dd82530670811a
2014-04-25 20:22:45 +00:00
dan
aa9933c115 Changes to the way the planner calculates the costs of various table and index scans. Some test cases still failing.
FossilOrigin-Name: c5a6ec0a880652dc8f4593d9f7acd58ddc3dc5f3
2014-04-24 20:04:49 +00:00
drh
c438df1be0 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 [1e64dd782a126f48d78].

FossilOrigin-Name: d5513dfa23baa0b0a095aaf17d19aacd30dcef61
2014-04-03 16:29:31 +00:00
drh
6284db908a 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.

FossilOrigin-Name: 01afbf97c0ff29667806e9a7c4d74ca717819de5
2014-03-19 23:24:49 +00:00
drh
7d9e7d8287 Improvements to likelihood processing so that commuting an unindexed term in
the WHERE clause does not change the query plan.

FossilOrigin-Name: 6e6bded055cdbc902731687c86d92c39a3ba5904
2013-09-11 17:39:09 +00:00
drh
09328c00d6 Additional unlikely() test cases. Logic tweaks to support test coverage.
FossilOrigin-Name: 5d00cce74a7aefaf30022ae971ab1e0451e0ad6e
2013-09-11 14:34:58 +00:00
drh
aae0f9e462 Change the name of the two-argument unlikely() function to likelihood().
Add test cases.

FossilOrigin-Name: 29a359b8d7f90e6fa2b28ce2a112284fd3870494
2013-09-11 11:38:58 +00:00