One more case is, that continuous IDs will make the svec more compact. For example. we have  6 transaction IDs, 1, 3, 5, 7, 9 and 15. All of which contains item 'a'. Then the svec for the 'a' is {1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1}:{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1}'. If the IDs are continuous (the IDs will be 1, 2, 3, 4, 5 and 6), then the svec is {6}:{1}. Especially, if the original dataset has a lot gaps, then it needs a lot of space. 

I understand the scalability of the window function. As you see, i will first check if they are continuous, then we will not invoke the window function.  As this encoding is one time operation, i would expect it will not spend too much time. The following log is from running ar_pos dataset on 40 segments, which has 515597 transaction IDs. The time for this step is 5.83, while the total time is 56.25.

```
INFO:  finished checking parameters
CONTEXT:  PL/Python function "assoc_rules"
INFO:  finished removing duplicates
CONTEXT:  PL/Python function "assoc_rules"
INFO:  finished encoding items
CONTEXT:  PL/Python function "assoc_rules"
INFO:  finished encoding input table: 5.83728909492
CONTEXT:  PL/Python function "assoc_rules"
INFO:  finished vertical table transforming: 0.648931026459
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Beginning iteration #1
CONTEXT:  PL/Python function "assoc_rules"
INFO:  141 Frequent itemsets found in this iteration
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Completed iteration # 1. Time: 0.130474805832
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Beginning iteration # 2
CONTEXT:  PL/Python function "assoc_rules"
INFO:  time of generating rules: 0.39672088623
CONTEXT:  PL/Python function "assoc_rules"
INFO:  389 Frequent itemsets found in this iteration
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Completed iteration # 2. Time: 3.85302996635
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Beginning iteration # 3 
CONTEXT:  PL/Python function "assoc_rules"
INFO:  time of generating rules: 0.451709985733
CONTEXT:  PL/Python function "assoc_rules"
INFO:  410 Frequent itemsets found in this iteration
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Completed iteration # 3. Time: 24.4801518917
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Beginning iteration # 4 
CONTEXT:  PL/Python function "assoc_rules"
INFO:  time of generating rules: 0.130084037781
CONTEXT:  PL/Python function "assoc_rules"
INFO:  151 Frequent itemsets found in this iteration
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Completed iteration # 4. Time: 16.4897310734
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Beginning iteration # 5
CONTEXT:  PL/Python function "assoc_rules"
INFO:  time of generating rules: 0.119781017303
CONTEXT:  PL/Python function "assoc_rules"
INFO:  8 Frequent itemsets found in this iteration
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Completed iteration # 5. Time: 4.15427207947
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Beginning iteration # 6
CONTEXT:  PL/Python function "assoc_rules"
INFO:  time of generating rules: 0.421010971069
CONTEXT:  PL/Python function "assoc_rules"
INFO:  0 Frequent itemsets found in this iteration
CONTEXT:  PL/Python function "assoc_rules"
INFO:  Completed iteration # 6. Time: 0.524311065674
CONTEXT:  PL/Python function "assoc_rules"
INFO:  begin to generate the final rules
CONTEXT:  PL/Python function "assoc_rules"
INFO:  5592 Total association rules found. Time: 0.133746862411
CONTEXT:  PL/Python function "assoc_rules"
 output_schema | output_table | total_rules |   total_time
---------------+--------------+-------------+-----------------
 test          | assoc_rules  |        5592 | 00:00:56.254781

```