On 2/8/07, Eddie Epstein <[EMAIL PROTECTED]> wrote:
Would another alternative be: when t2 is indexed, create the bag index for t1 (assuming t1 is derived from TOP, else t1's parent directly derived from TOP)?
This seems about equivalent to Thilo's proposal, except it does not handle the case where the user has defined a custom index on t2. See below.
On 2/8/07, Thilo Goetz <[EMAIL PROTECTED]> wrote: > The same issue exists when an index for t2 has been defined by the user. > For annotators designed for high performance, creating many objects, > this can have a severe performance impact. > > I would like to propose the following solution, though I'm not sure how > difficult it will be to implement. We create a special kind of index > that does not follow the usual type inheritance scheme (i.e., if it's > defined for t1, it's not necessarily defined for t2). We create this > index for all types without an index the first time somebody tries to > index an FS with no index defined. The global index will have a slight > performance impact for all indexing operations, but I hope it will be > slight, and certainly less problematic than what we have now. >
When you iterate over such a "special" index, though, would it still pull from indexes over subtypes? I think it would need to, including in the case where there's a custom index defined over one of the subtypes. For example, say there's a custom index on t2 which has some FS in it. Then the user adds to indexes an instance of t1 (supertype of t2). We create a "special" bag index over t1 only - a corresponding instance of t2 is not created. Now if the user calls getAllIndexedFS(t1), they need to get an iterator that does return them the instances of t2 that were added to the custom index. Assuming this is implementable, it seems like the right thing to do. -Adam
