我在这里有火鸟查询,我是使用火鸟和索引的新手。我想通过使用索引来优化我的查询。但我不知道如何,这是我的查询:
SELECT
a.TESTER,
a.LOT_ID,
/* DATEDIFF (SECOND FROM START_LOG_TIME TO ENDLOGTIME) AS ELAPSED_TIME */
b.TEST_DESC,
COUNT(TEST_DESC) AS TOTAL_DESC,
MIN(MEASUREMENT) AS MIN_MEASUREMENT,
AVG(MEASUREMENT) AS TOTAL_MEASUREMENT,
MAX(MEASUREMENT) AS MAX_MEASUREMENT,
AVG(LL) AS LL,
AVG(UL) AS UL,
SUM(IIF(MEASUREMENT<LL,1,0)) AS RESULT
FROM T_TABLE1 a
INNER JOIN T_TABLE2 b
ON a.ID = b.TBL1_ID
AND a.TESTER = b.TESTER
AND a.LOT_ID = b.LOT_ID
WHERE b.GRP = 'Contact'
GROUP BY
a.TESTER,
a.LOT_ID,
b.TEST_DESC
对于T_TABLE2,我尝试创建名为TEST_DESC_IDX的索引。我为 TEST_DESC 字段创建了索引。
谢谢您的帮助!!