You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gi...@git.apache.org on 2017/04/05 17:48:54 UTC
[GitHub] tonysun83 opened a new pull request #471: Use efficient set storage for field names
tonysun83 opened a new pull request #471: Use efficient set storage for field names
URL: https://github.com/apache/couchdb/pull/471
<!-- Thank you for your contribution!
Please file this form by replacing markdown commentary
tags with the text. If section needs in no action - remove it.
Also remember, that CouchDB uses the Review-Then-Commit (RTC) model
of code collaboration. Positive feedback provides by +1 from committers
while negative by -1. The -1 also means veto and need to be addressed
to find the consensus. Once there are no objections, PR could be merged.
See: http://couchdb.apache.org/bylaws.html#decisions for more info -->
## Overview
When indexing a set of fields for text search, we also create a special
field called $fieldnames. It contains values for all the fields that
need to be indexed. In order to do that, we need a unique list of the
form [[<<"$fieldnames">>, Name, []] | Rest]. The old code would add an
element to the list, and then check for membership via lists:member/2.
This is inefficient. Some documents can contain a large number of
fields, so we will use gb_sets to create a unique set of fields, and
then extract out the field names.
## Testing recommendations
There are no usability changes for the user as this is a performance enhancement. A full regression should be sufficient. It requires https://github.com/cloudant-labs/dreyfus to be installed.
<!-- Describe how we can test your changes.
Does it provides any behaviour that the end users
could notice? -->
## JIRA issue number
COUCHDB-3358
<!-- If this is a significant change, please file a JIRA issue at:
https://issues.apache.org/jira/browse/COUCHDB
and include the number here and in commit message(s) -->
## Related Pull Requests
<!-- If your changes affects on multiple components in different
repositories please list here links to those pull requests. -->
## Checklist
- [ ] Code is written and works correctly;
- [ ] Changes are covered by tests;
- [ ] Documentation reflects the changes;
- [ ] I will not forget to update [rebar.config.script](https://github.com/apache/couchdb/blob/master/rebar.config.script)
with the correct commit hash once this PR get merged.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services