When you have a single space with two indexes, how do you specify an index in your BW GET process? From Designer, it will only show you the fields from the HASH KEY. Is there a different way to do this?

When you have a single space with two indexes, how do you specify an index in your BW GET process? From Designer, it will only show you the fields from the HASH KEY. Is there a different way to do this?

book

Article ID: KB0089345

calendar_today

Updated On:

Products Versions
TIBCO ActiveSpaces -
Not Applicable -

Description

Description:
When you have a single space with two indexes, how do you specify an index in your BW GET process? From Designer,
it will only show you the fields from the HASH KEY. Is there a different way to do this?

Resolution

You can create an index from the BW AS Plugin as well. Under the Space Palette, navigate to the index tab for creating indexes on space. You can also create an index from the as-admin tools. All the space definitions created from the standalone AS can be "Introspected" into BW.

From BW GET process you need to provide only "Key" fields to retrieve the matched tuple. GET always returns a matched tuple from the space. You can use the Snapshot or Snapshot Iterator activity to retrieve matched tuples using indexes if you have a space "Order' with Order_id, Order_Value as indexed fields.

provide "Order_id>100' in the Snapshot or Snapshot Iterator activity.
provide "Order_Value < 1000' in the Snapshot or Snapshot Iterator activity.

You can create a composite index if you have a space "Order' with Order_id,Order_Value as composite an indexed field.
Provide "Order_id>100 AND Order_Value < 1000 ' in the Snapshot or Snapshot Iterator activity.

Define an index on the key fields, which is then used automatically by put/get/take/lock/etc... operations. By default, that index is of type "HASH" since a get is a sort of 'equality' query on the index field values. Make sure you define the secondary index of type "TREE" (rather than HASH) if you are doing 'range queries' (i.e., queries using '>' and '<' like in his example). A hash index does not accelerate range queries, only equality queries. Also note that TREE indexes can also be leveraged to speed up equality queries, but if there's also a HASH index available on the space the query engine will use that for equality clauses since that's the fastest (and the TREE index for ranges). This means that if you have both queries with '=' and queries with '<' or '>' on the same field(s), you can just define a TREE index and save some memory from defining both a TREE and a HASH index. This will provide the best possible performance but at the expense of more memory being used to store two indexes rather than one.

Issue/Introduction

When you have a single space with two indexes, how do you specify an index in your BW GET process? From Designer, it will only show you the fields from the HASH KEY. Is there a different way to do this?