Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Combining compound and extended indexes

Since compound indexes can only consist of BASIC (equality-only) properties or paths, would it still be beneficial to define EXTENDED (less-than,greater-than) indexes on commonly-used numeric properties?

For example, given the following frequently-executed query:

where A = ? and B = ? and (C is null or C <= ?)

where A and B are strings, and C is a date, I would ideally define a compound index over A(BASIC),B(BASIC), and C(EXTENDED). But since EXTENDED indexes aren't supported in compound indexes, it seems the best I can do is create one compound index over A,B, and a separate EXTENDED index over C. Is there any better way to optimize for this query?


asked 2015-08-19 15:32:20 -0500

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

Since the query is evaluated using the index with the smallest matching set , the approach you described might work the best.

If C has a small number of indexed values , where A or B indexes holding way larger amount of indexed values (smaller potential matching space objects than C) , you might want to drop the index on C.

This how the matching phase where the entries are evaluated against the query will iterate small candidate set and your write operation will not need to index C.

I suggest you test the performance with and without having C indexed and make a decision.

Remember also the extended index does have a noticeable footprint. So indexes should be used with care.

answered 2015-08-20 08:19:19 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-08-19 15:32:20 -0500

Seen: 264 times

Last updated: Aug 20 '15