[ 
https://issues.apache.org/jira/browse/SOLR-9764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15703181#comment-15703181
 ] 

Michael Sun edited comment on SOLR-9764 at 11/28/16 9:27 PM:
-------------------------------------------------------------

Uploaded a new patch with all tests passed.

bq. What is the issue with intDocSet?
Basic in DocSetBase.equals(), both DocSet are converted to FixedBitSet and then 
both FixedBitSet are compared. However, both DocSet may go through different 
code path and resize differently in conversion even these two DocSet are equal. 
The result is that one FixedBitSet has more zero paddings than the other which 
makes FixedBitSet.equals() think they are different. 

The fix is to resize both FixedBitSet to the same larger size before comparison 
in DocSetBase.equals(). Since DocSetBase.equals() is marked for test purpose 
only, the efficiency of the extra sizing would not be a problem.


was (Author: michael.sun):
Uploaded a new patch with all tests passed.

bq. What is the issue with intDocSet?
Basic in DocSetBase.equals(), both DocSet are converted to FixedBitSet and then 
both FixedBitSet are compared. However, both DocSet may go through different 
code path and resize differently in conversion even these two DocSet are equal. 
The result is taht one FixedBitSet has more zero paddings than the other which 
makes FixedBitSet.equals() think they are different. 

The fix is to resize both FixedBitSet to the same larger size before comparison 
in DocSetBase.equals(). Since DocSetBase.equals() is marked for test purpose 
only, the efficiency of the extra sizing would not be a problem.

> Design a memory efficient DocSet if a query returns all docs
> ------------------------------------------------------------
>
>                 Key: SOLR-9764
>                 URL: https://issues.apache.org/jira/browse/SOLR-9764
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Michael Sun
>         Attachments: SOLR-9764.patch, SOLR-9764.patch, SOLR-9764.patch, 
> SOLR-9764.patch, SOLR-9764.patch, SOLR_9764_no_cloneMe.patch
>
>
> In some use cases, particularly use cases with time series data, using 
> collection alias and partitioning data into multiple small collections using 
> timestamp, a filter query can match all documents in a collection. Currently 
> BitDocSet is used which contains a large array of long integers with every 
> bits set to 1. After querying, the resulted DocSet saved in filter cache is 
> large and becomes one of the main memory consumers in these use cases.
> For example. suppose a Solr setup has 14 collections for data in last 14 
> days, each collection with one day of data. A filter query for last one week 
> data would result in at least six DocSet in filter cache which matches all 
> documents in six collections respectively.   
> This is to design a new DocSet that is memory efficient for such a use case.  
> The new DocSet removes the large array, reduces memory usage and GC pressure 
> without losing advantage of large filter cache.
> In particular, for use cases when using time series data, collection alias 
> and partition data into multiple small collections using timestamp, the gain 
> can be large.
> For further optimization, it may be helpful to design a DocSet with run 
> length encoding. Thanks [~mmokhtar] for suggestion. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to