Hey team, how I can make sure star tree index usin...
# getting-started
b
Hey team, how I can make sure star tree index using for a query? To double check I used star tree recipe, and here is plans for queries in inverted index table (FILTER_INVERTED_INDEX) and stree table(FILTER_FULL_SCAN).
m
Is the query faster and does response metadata say that it is scanning less documents?
b
scanned 4 docs in any cases, but numEntriesScannedInFilter and numEntriesScannedPostFilter can be different
Copy code
stree:
numEntriesScannedInFilter: 0
numEntriesScannedPostFilter: 8
inverted:
numEntriesScannedInFilter: 0
numEntriesScannedPostFilter: 8
no index:
numEntriesScannedInFilter: 1000
numEntriesScannedPostFilter: 4
does it mean request plan doesn’t tell about using star tree index?
I got nice performance results with inverted and range index only but I would like to have faster aggregations
m
What are the above stats without ST index? It also depends on dimension split order and max leaf records on whether ST index is used or effective
b
What are the above stats without ST index?
same request to different tables with different index
I think I asked a bit wrong question cause I have the same issue with my project too (use full scan or inverted index instead of ST index). And could you share please some best practices for it? In general I have 3 fields: • nameOrig • nameDest • action and a few of date time fields
Copy code
"dateTimeFieldSpecs": [
    {
      "name": "settlementTime",
      "dataType": "STRING",
      "format": "SIMPLE_DATE_FORMAT",
      "granularity": "1:MILLISECONDS",
      "notNull": true
    },
    {
      "name": "settlementTimeMs",
      "dataType": "LONG",
      "format": "EPOCH",
      "granularity": "1:MINUTES",
      "notNull": true
    },
    {
      "name": "settlementTimeMin",
      "dataType": "LONG",
      "format": "EPOCH",
      "granularity": "1:MINUTES",
      "notNull": true
    }
  ]
and I would like to run 10-50k queries/s with settlement ranges from 1 min up to 1 year with >100 ms latency
Copy code
select
    "action" as method,
    count(*) as documents,
    sum(amount) as total_amount,
    max(amount) as max_amount,
    min(amount) as min_amount,
    avg(amount) as avg_amount,
    PERCENTILE(amount, 50) as p50,
    PERCENTILE(amount, 85) as p85,
    PERCENTILE(amount, 95) as p95,
    PERCENTILE(amount, 99.9) as p99_9
from transactions
where nameOrig = :nameOrig and nameDest = :nameDest
and settlementTimeMin between :fromSettlementTimeMin and :toSettlementTimeMin
group by "action";
I’m not sure but ST index will not suit here cause it can be 0, 1 or 2 tx peer minute(human can’t pay faster lol). Maybe split settlement into columns for each time unit and add that columns into dimensionsSplitOrder?