Hey everyone :wave: Can a star-tree index be used ...
# troubleshooting
l
Hey everyone 👋 Can a star-tree index be used with a multi-dimensional column specified in the split order?
k
you mean multi-valued column?
l
Yes, sorry
k
No, start-tree index cannot support multi-valued column.. the behavior is undefined
l
When you say cannot support, do you mean currently, or ever?
k
ever
l
Suppose you have a table which has these following dimensions
Copy code
entityId: String
groupIds: List of strings
status: String
And a query looking like this
Copy code
SELECT COUNT(*) FROM table WHERE entityId = 'ID' AND groupIds CONTAINS 'group_1' AND status = 'ONLINE'
If there are 2 billion rows here, this could be a very intense query. If the star tree index could pre-aggregate on each value in groupId, you could potentially make this lookup much more performant. This is pretty much a problem we have today. A group can contain multiple entities, and an entity can be in multiple groups. There is a many to many relationship, meaning this is a dynamic constraint of our queries. Some queries will ignore group, (that would be the star node), while some need to access the aggregation on a group basis.
How would I go about solving that problem?
Would I need to use complex type to create 1 row per group?
k
if there is only one attribute in the query, we can solve it but its hard to solve groupIds contains group_1, group_2
because its not additive anymore
l
Right that makes perfect sense. In my case the query would only ever contain one groupId, so I guess in theory that could work then
The problem is the split order becomes exclusive on one groupId for a specific aggregation
because there is no aggregation considering filtering on multiple groups..
I still think that would be a very useful thing to have, it would obviously have to be constrained as you mention
k
yeah, thats a possibility to support it with that constraint.. can you please file a github issue with the example you have
l
Yes 👍 I'll do that