Hi Team, Please help me understand why I don't see...
# troubleshooting
a
Hi Team, Please help me understand why I don't see explicit use of star-tree index in explain plan of a query. Not sure if i am reading wrong, or using index wrong. Trying to give as much detail as possible. Please let me know if more info needed to help understand I have below star tree index
Copy code
"starTreeIndexConfigs": [
        {
          "dimensionsSplitOrder": [
            "request_metadata.request.account",
            "Normalized_Path",
            "request_metadata.request.verb",
            "request_metadata.request.application_id",
            "Is_Error",
            "created_at"
          ],
          "functionColumnPairs": [
            "COUNT__*",
            "PERCENTILE_EST__request_metadata.response.elapsed_time"
          ],
          "maxLeafRecords": 10000
        }
      ],
Is_Error and Normalized_Path are transformed columns ( these have use cases in other queries)
Copy code
"transformConfigs": [
        {
          "columnName": "Is_Error",
          "transformFunction": "not(greater_than_or_equal(request_metadata.response.response_status, 200) AND less_than_or_equal(request_metadata.response.response_status, 299))"
        },
        {
          "columnName": "Normalized_Path",
          "transformFunction": "regexp_replace(request_metadata.request.path, '/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9]+|[0-9a-fA-F]{24})(?=/|$)', '/{id}')"
        }
      ],
Query
Copy code
explain plan for
SELECT   dateTimeConvert( created_at, '1:MILLISECONDS:EPOCH', '1:MILLISECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd HH:mm:ss', '12:HOURS' ) AS MetricUsageDate,
         PERCENTILEEST(request_metadata.response.elapsed_time,50)                                                                   AS MedianLatency
FROM     GatewayApiUsageTest
WHERE    created_at >= '2025-01-01 11:30:00'
         AND created_at <= '2025-02-01 18:30:00'
         AND request_metadata.request.account = 'photfix'
GROUP BY MetricUsageDate
ORDER BY MetricUsageDate LIMIT 1000
We do see a difference in performance stats with and without the star tree index With Index
Copy code
"timeUsedMs": 56,
  "numDocsScanned": 59659,
  "totalDocs": 415282,
  "numEntriesScannedInFilter": 1463,
  "numEntriesScannedPostFilter": 119318,
Without Index
Copy code
"timeUsedMs": 35,
  "numDocsScanned": 124785,
  "totalDocs": 415331,
  "numEntriesScannedInFilter": 387071,
  "numEntriesScannedPostFilter": 249570,
But I don't see any use of the index in the explain plan
Copy code
Operator	Operator_Id	Parent_Id

BROKER_REDUCE(sort:[datetimeconvert(created_at,'1:MILLISECONDS:EPOCH','1:MILLISECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd HH:mm:ss','12:HOURS') ASC],limit:1000)	1	0
COMBINE_GROUP_BY	2	1
PLAN_START(numSegmentsForThisPlan:4)	-1	-1
GROUP_BY(groupKeys:datetimeconvert(created_at,'1:MILLISECONDS:EPOCH','1:MILLISECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd HH:mm:ss','12:HOURS'), aggregations:percentileEst(request_metadata.response.elapsed_time))	3	2
TRANSFORM(datetimeconvert(created_at,'1:MILLISECONDS:EPOCH','1:MILLISECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd HH:mm:ss','12:HOURS'), request_metadata.response.elapsed_time)	4	3
PROJECT(request_metadata.response.elapsed_time, created_at)	5	4
DOC_ID_SET	6	5
FILTER_FULL_SCAN(operator:EQ,predicate:request_metadata.request.account = 'photfix')	7	6