<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/couchdb.git/src/mango/test/05-index-selection-test.py, branch decrease-indexer-transaction-time-limit</title>
<subtitle>github.com: apache/couchdb.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/'/>
<entry>
<title>update mango tests to work with Mango on FDB</title>
<updated>2020-04-06T15:55:49+00:00</updated>
<author>
<name>Garren Smith</name>
<email>garren.smith@gmail.com</email>
</author>
<published>2020-03-31T09:39:58+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=29ef7fb37007821edd8a0673226090cd47d48bab'/>
<id>29ef7fb37007821edd8a0673226090cd47d48bab</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Windows build (#2534)</title>
<updated>2020-02-08T05:30:31+00:00</updated>
<author>
<name>Joan Touzet</name>
<email>wohali@users.noreply.github.com</email>
</author>
<published>2020-02-08T05:30:31+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=24e2c8bf61a4e82504ea6e6ba2caa779980b9597'/>
<id>24e2c8bf61a4e82504ea6e6ba2caa779980b9597</id>
<content type='text'>
* Allows `configure.ps1` to correctly pull and build `rebar` on Windows
* Removes the static declarations in `rebar.config.script` on
  specific, pre-determined paths to various includes/libraries
  necessary for NIFs and external binaries (expectation is these are
  passed in env vars INCLUDE, LIB and LIBPATH)
* fixes the SM60 `couchjs` build by telling `windows.h` not to
  redefine min and max as macros through a `#define`
* fixes the `make eunit` target on Windows
* Adds the missing `EXE_LINK_CXX_TEMPLATE` that our rebar doesn't have,
  but `enc` has today, which is also causing a failed `couchjs` (C++)
  build on Windows
* Causes `make python-black` to correctly cause failure in `make check`
  if it finds problems
* fixes Mango tests on Python 3.8 by bumping the hypothesis dependency
* fixes one Elixir test on Windows (incorrect calculation of `now(:ms)`
  due to Erlang clock precision difference)
* a little bit of python black cleanup (mango tests)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Allows `configure.ps1` to correctly pull and build `rebar` on Windows
* Removes the static declarations in `rebar.config.script` on
  specific, pre-determined paths to various includes/libraries
  necessary for NIFs and external binaries (expectation is these are
  passed in env vars INCLUDE, LIB and LIBPATH)
* fixes the SM60 `couchjs` build by telling `windows.h` not to
  redefine min and max as macros through a `#define`
* fixes the `make eunit` target on Windows
* Adds the missing `EXE_LINK_CXX_TEMPLATE` that our rebar doesn't have,
  but `enc` has today, which is also causing a failed `couchjs` (C++)
  build on Windows
* Causes `make python-black` to correctly cause failure in `make check`
  if it finds problems
* fixes Mango tests on Python 3.8 by bumping the hypothesis dependency
* fixes one Elixir test on Windows (incorrect calculation of `now(:ms)`
  due to Erlang clock precision difference)
* a little bit of python black cleanup (mango tests)
</pre>
</div>
</content>
</entry>
<entry>
<title>Return mango warnings as a delimited string</title>
<updated>2020-02-03T11:05:21+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2020-02-03T10:19:59+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=a19b9ff23ddb7da217954f963009d38c630891a7'/>
<id>a19b9ff23ddb7da217954f963009d38c630891a7</id>
<content type='text'>
The CouchDB API defines the warning field returned by _find to be
a string (and this is what Fauxton expects). 5d55e289 was missing
a string conversion and returned the warning(s) as an array. This
restores the intended behaviour.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The CouchDB API defines the warning field returned by _find to be
a string (and this is what Fauxton expects). 5d55e289 was missing
a string conversion and returned the warning(s) as an array. This
restores the intended behaviour.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor Mango warning generation</title>
<updated>2020-01-17T13:54:34+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2020-01-06T09:22:56+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=f86747f02a8b066f136a275fa28e92200404d0e7'/>
<id>f86747f02a8b066f136a275fa28e92200404d0e7</id>
<content type='text'>
Refactor the code generating Mango warnings to (hopefully!)
improve readability.

This also moves the metric counter for unindexed queries such that it
gets incremented only when no index is used. Previously, it would
increment if *any* warning was generated (e.g. when Mango warned that
the user-specified index was not found/valid but fell back to a
different index).

The warning string returned now also contains all warnings generated
for the query, delimited via newlines - not just the first one.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactor the code generating Mango warnings to (hopefully!)
improve readability.

This also moves the metric counter for unindexed queries such that it
gets incremented only when no index is used. Previously, it would
increment if *any* warning was generated (e.g. when Mango warned that
the user-specified index was not found/valid but fell back to a
different index).

The warning string returned now also contains all warnings generated
for the query, delimited via newlines - not just the first one.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use index names when testing index selection</title>
<updated>2019-01-18T19:03:28+00:00</updated>
<author>
<name>Paul J. Davis</name>
<email>paul.joseph.davis@gmail.com</email>
</author>
<published>2018-12-19T17:48:45+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=47efcbdc41956f57b747925ea12fb9ef1036fd7b'/>
<id>47efcbdc41956f57b747925ea12fb9ef1036fd7b</id>
<content type='text'>
Using the internal hash values for indexes was a brittle approach to
ensuring that a specific index was or was not picked. By naming the
index and design docs we can more concretely ensure that the chosen
indexes match the intent of the test while also not breaking each time
mango internals change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using the internal hash values for indexes was a brittle approach to
ensuring that a specific index was or was not picked. By naming the
index and design docs we can more concretely ensure that the chosen
indexes match the intent of the test while also not breaking each time
mango internals change.
</pre>
</div>
</content>
</entry>
<entry>
<title>Format and check all code using python black (#1776)</title>
<updated>2018-12-06T23:03:57+00:00</updated>
<author>
<name>Joan Touzet</name>
<email>wohali@users.noreply.github.com</email>
</author>
<published>2018-12-06T23:03:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=33d4f6d02715a204ef2dd7ddc4795aed5c1b72ce'/>
<id>33d4f6d02715a204ef2dd7ddc4795aed5c1b72ce</id>
<content type='text'>
The Makefile target builds a python3 venv at .venv and installs
black if possible. Since black is Python 3.6 and up only, we
skip the check on systems with an older Python 3.x.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Makefile target builds a python3 venv at .venv and installs
black if possible. Since black is Python 3.6 and up only, we
skip the check on systems with an older Python 3.x.</pre>
</div>
</content>
</entry>
<entry>
<title>Allow to use index with or (#1038)</title>
<updated>2017-12-11T13:25:53+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2017-12-11T13:25:53+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=0493988a7509a4059429ff48dc93bf5ce287da1f'/>
<id>0493988a7509a4059429ff48dc93bf5ce287da1f</id>
<content type='text'>
Since #816, mango JSON index on compound fields can be 
selected only if the selector make sure that all the fields 
listed in the index are always present. 

This adds a special case where all clauses of an `$or` can
ensure that a field is present.

For instance, if I had an index:

[A, B]

is_usable would now return true for the selector:

{
  "A": "foo",
  "$or": {
    "B": "bar",
    "B": "baz"
  }
}

but false for:

{
  "A": "foo",
  "$or": {
    "B": "bar",
    "C": "bar"
  }
}</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since #816, mango JSON index on compound fields can be 
selected only if the selector make sure that all the fields 
listed in the index are always present. 

This adds a special case where all clauses of an `$or` can
ensure that a field is present.

For instance, if I had an index:

[A, B]

is_usable would now return true for the selector:

{
  "A": "foo",
  "$or": {
    "B": "bar",
    "B": "baz"
  }
}

but false for:

{
  "A": "foo",
  "$or": {
    "B": "bar",
    "C": "bar"
  }
}</pre>
</div>
</content>
</entry>
<entry>
<title>warn instead of error when use_index not valid (#962)</title>
<updated>2017-11-30T19:53:19+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2017-11-30T19:53:19+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=743bd8820cf612e830c1ff6dd0b9b07c12aab8fb'/>
<id>743bd8820cf612e830c1ff6dd0b9b07c12aab8fb</id>
<content type='text'>
If a user specifies a value for use_index that is not
valid for the selector - i.e. it does not meet the coverage
requirements of the selector or sort fields - attempt
to fall back to a valid index (or database scan) rather
than returning a 400 error.

When a fallback occurs, populate the "warning" field
in the response (as we already do when a full database
scan takes place) with details of the fallback.

This change is partially as mitigation for #816, which may
lead to some previously valid indexes being deemed invalid,
and also to make use_index less brittle in general. If
an index that is used explicitly by active queries is removed,
Couch will now generate warnings and there may be a performance
impact, but the client will still get correct results.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a user specifies a value for use_index that is not
valid for the selector - i.e. it does not meet the coverage
requirements of the selector or sort fields - attempt
to fall back to a valid index (or database scan) rather
than returning a 400 error.

When a fallback occurs, populate the "warning" field
in the response (as we already do when a full database
scan takes place) with details of the fallback.

This change is partially as mitigation for #816, which may
lead to some previously valid indexes being deemed invalid,
and also to make use_index less brittle in general. If
an index that is used explicitly by active queries is removed,
Couch will now generate warnings and there may be a performance
impact, but the client will still get correct results.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix _explain for sort descending (#1025)</title>
<updated>2017-11-28T11:30:14+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2017-11-28T11:30:14+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=27dcd6b3eb85017d4103c89182fd11f82d1a7752'/>
<id>27dcd6b3eb85017d4103c89182fd11f82d1a7752</id>
<content type='text'>
Handle the case when startkey and endkey
are reversed. To create valid JSON we need to
replace the internal representation of the startkey
with a string.

Fixes #1023</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Handle the case when startkey and endkey
are reversed. To create valid JSON we need to
replace the internal representation of the startkey
with a string.

Fixes #1023</pre>
</div>
</content>
</entry>
<entry>
<title>Fix index validation for nested $and (#1014)</title>
<updated>2017-11-23T08:04:17+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2017-11-23T08:04:17+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=ede5dd9675285157410311aa8e2ed01c7f5e597e'/>
<id>ede5dd9675285157410311aa8e2ed01c7f5e597e</id>
<content type='text'>
mango_selector:has_required_fields checks that a list of
indexed fields is covered by a given selector. The implementation
recurses through the selector, tracking fields that encounters.

Unfortunately, this skipped peers of combination operators. For
example,

"selector": {
	"$and":[
		"$and":[
			"A": "foo"
		],
		"$and":[
			"B": "bar"
		]
	]
}

would skip the first nested "$and" operator and only return "B"
as a covered field.

This commit explicitly handles this situation (the only combination
operator we care about is $and), so for the above selector we
would correctly indentify "A" and "B" as covered fields.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
mango_selector:has_required_fields checks that a list of
indexed fields is covered by a given selector. The implementation
recurses through the selector, tracking fields that encounters.

Unfortunately, this skipped peers of combination operators. For
example,

"selector": {
	"$and":[
		"$and":[
			"A": "foo"
		],
		"$and":[
			"B": "bar"
		]
	]
}

would skip the first nested "$and" operator and only return "B"
as a covered field.

This commit explicitly handles this situation (the only combination
operator we care about is $and), so for the above selector we
would correctly indentify "A" and "B" as covered fields.</pre>
</div>
</content>
</entry>
</feed>
