Moh*_*igh 0 sql oracle indexing
如何为以下案例创建功能索引.
CREATE INDEX index1 ON table1(MIN(col1));
它给出了以下错误: SQL Error: ORA-00934: group function is not allowed here
请帮忙!
如果你想在其上创建一个索引col1将加速像这样的查询:
SELECT MIN(col1)
FROM table1
Run Code Online (Sandbox Code Playgroud)
那么你不需要功能索引.只需像这样创建普通索引:
CREATE INDEX index1 ON table1(col1);
Run Code Online (Sandbox Code Playgroud)
创建功能索引MIN(col1)- 如果可能 - 将导致索引具有col1每行的相同值(最小值).这样的指数完全没用.
| 归档时间: |
|
| 查看次数: |
416 次 |
| 最近记录: |